473,383 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Need a Little Help on Tkinter and Python

I have about a 1600 line Pythron program I'd like to make some simple mods
to, but have really just a nodding acquaintance with Python and Tkinter. I
know quite a few languages, including C++. Let's change that. I've not used
anything but C in recent years, and C++ was in my bag before that along with
a number of aged languages.

The biggest change I want to make is the single simple screen titles, top
and bottom. The top was easy, since it had one word. Although, it might be
good to center the title. The title at the bottom really is a file name that
changes as data is examined. Here's the general lay of the land. Any clues
to what needs to be done? is there a Tkinter intro manual somewhereI have
a very short Python pdf that mostly deals with Python in terms of a script
language. It's maybe 60 pages long. BTW, is there a Main, or where does the
executable first start?

-----------------------------------
|Title line
|Menu line (pull downs)
|
|
|Image area of a picture of the sky
|
|
|Bottom line with <-, ->, ->||, etc. scroll tools plus the current file name
| on display. There's a delete button there too, along with camera on/off.
----------------------------------

Each time a camera takes a picture of the sky, it appears in the image area.
Images are taken randomly about every 10-15 minutes for the night. An
operator can use the scroll tools to go sequentially up and down the images
at any time. Each time a new image file appears, the file name is updated.
They are of the form v20070612_183015b.dat. Year, month, date, hour, min,
sec. I want to change or add somewhere on the line just the date and time in
bold or in some color: 05/12/07 at 13:30:15 for the above.

Here's an excerpt of a data structure that probably is key to the display:

def __init__(self, master):
self.master = master
master.title( MAIN_TITLE )
self.running = True
self.channel = None
self.reference_image = None
self.current_image = None
self.subimages = None
self.current_path = None
self.current_image_data = None
self.current_subimage_data = None
...

and some code:
self.previousButton = Button(botmain,text="<<-",state=NORMAL,
font=("Courier",8),
command=self.PlayPrevious,
takefocus=0)
self.previousButton.grid(row=0,column=5,sticky=W)

self.nextButton = Button(botmain,text="->>",state=NORMAL,
font=("Courier",8),
command=self.PlayNext,
takefocus=0)
self.nextButton.grid(row=0,column=6,sticky=W)

self.lastButton = Button(botmain,text=">||",state=NORMAL,
font=("Courier",8),
command=self.PlayLast,
takefocus=0)
self.lastButton.grid(row=0,column=7,sticky=W)

self.replayButton = Button(botmain,text="Replay",state=NORMAL,
command=self.Replay,
takefocus=0)
self.replayButton.grid(row=0,column=8,sticky=W)

self.compositeButton = Button(botmain,text="Composite",state=NORMAL,
command=self.Composite,
takefocus=0)
self.compositeButton.grid(row=0,column=9,sticky=W)

self.deleteButton = Button(botmain,text="Delete",state=NORMAL,
command=self.Delete,
takefocus=0)
self.deleteButton.grid(row=0,column=10,sticky=W)

self.MakeSelectsAndWeights()

self.Focus()

--
Wayne Watson (Nevada City, CA)

Web Page: <speckledwithStars.net>
Jun 6 '07 #1
4 1281
On 6 Jun, 00:58, "W. Watson" <wolf_tra...@invalid.comwrote:
is there a Tkinter intro manual somewhere
Take a look at http://www.pythonware.com/library/tkinter/introduction

Glenn

Jun 6 '07 #2
"W. Watson" schrieb
I have about a 1600 line Pythron program I'd like to
make some simple mods to, but have really just a nodding
acquaintance with Python and Tkinter.
[...]
Let's change that.
The book "Learning Python" from O'Reilly is excellent.

If you are into scientific programming, the book
"Python Scripting for Computational Science"
by Hans Petter Langtangen from Springer is useful.

HTH
Martin

Jun 6 '07 #3
Thanks for your responses. I've located the URL from the post above and will
check out the two books mentioned here. I used to do a lot of scientific
programming, but now just concentrate on science.

Martin Blume wrote:
"W. Watson" schrieb
>I have about a 1600 line Pythron program I'd like to
make some simple mods to, but have really just a nodding
acquaintance with Python and Tkinter.
[...]
Let's change that.

The book "Learning Python" from O'Reilly is excellent.

If you are into scientific programming, the book
"Python Scripting for Computational Science"
by Hans Petter Langtangen from Springer is useful.

HTH
Martin
--
Wayne Watson (Nevada City, CA)

Web Page: <speckledwithStars.net>
Jun 6 '07 #4
Is there a pdf file or downloadable file of the Tkinter material? I like to
put stuff in notebooks.

W. Watson wrote:
Thanks for your responses. I've located the URL from the post above and
will check out the two books mentioned here. I used to do a lot of
scientific programming, but now just concentrate on science.

Martin Blume wrote:
>"W. Watson" schrieb
>>I have about a 1600 line Pythron program I'd like to make some simple
mods to, but have really just a nodding acquaintance with Python and
Tkinter. [...]
Let's change that.

The book "Learning Python" from O'Reilly is excellent.
If you are into scientific programming, the book
"Python Scripting for Computational Science"
by Hans Petter Langtangen from Springer is useful.

HTH
Martin
--
Wayne Watson (Nevada City, CA)

Web Page: <speckledwithStars.net>
Jun 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: srijit | last post by:
Hello, Any idea - why the following code crashes on my Win 98 machine with Python 2.3? Everytime I run this code, I have to reboot my machine. I also have Win32all-157 installed. from Tkinter...
3
by: Phil Schmidt | last post by:
I'm trying to make a custom entry widget, as in the code that follows. There are two problems I'm trying to fix: 1) I would like the widget to behave as myEntry.Escape() does now, except that it...
14
by: Jeffrey Barish | last post by:
Since upgrading to python 2.4 yesterday, I am no longer able to use Tkinter. From http://www.python.org/moin/TkInter I learned that I need to edit Modules/Setup to include Tkinter during the make....
1
by: John Chambers | last post by:
Sp my latest adventure is attempting to use python's Tkinter module on a few machines. On my PB (OSX 10.3.9), I got the following confusing results: /Users/jc: python Python 2.3 (#1, Sep 13...
1
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that...
5
by: Ben Kovitz | last post by:
Hi, I just tried to run Tkinter on OS X 10.3.9 under Python 2.4.3, and I'm getting a bus error as soon as I call Tk(). Googling has turned up info other Tkinter bus errors, but not this one that...
13
by: Daniel Fetchinson | last post by:
Was looking at PEP 3108, http://www.python.org/dev/peps/pep-3108/ , Is it just me or others also think that it would be a major loss to remove tkinter from the python core? PEP 3108 starts off...
2
by: Dudeja, Rajat | last post by:
Hi, So, now I've finally started using Eclipse and PyDev as an IDE for my GUI Application. I just wrote some sample programs as an hands on. Now I would like to take up Tkinter. I'm using...
4
by: njwilson23 | last post by:
I'm having trouble with tkinter on a new installation of Python (2.6), built with the framework option from source that was downloaded from python.org. I'm running OS 10.4 on a PowerPC G4. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.