By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,106 Members | 2,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,106 IT Pros & Developers. It's quick & easy.

Need a Little Help on Tkinter and Python

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.