473,406 Members | 2,619 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,406 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 1282
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.