Need a Little Help on Tkinter and Python

W

W. Watson

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 somewhere> I 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()
 
M

Martin Blume

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
 
W

W. Watson

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 said:
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
 
W

W. Watson

Is there a pdf file or downloadable file of the Tkinter material? I like to
put stuff in notebooks.

W. Watson said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top