473,406 Members | 2,620 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.

Learning Python - First Project

Hi,

I am new to Python and am trying to write a little front end to
another application in Python.

What I want is to have a gui pop up listing some items with several
buttons. The guts of the program I am not having any trouble with but
the GUI part I am (or more accurately, the transition between GUI
pieces).

The first GUI that pops up lists some groups in a listbox and gives
the user the choice to create a new group, open a group, rename the
group, or delete the group. The new group and rename group buttons
pop up a dialog gui asking for the name/new name. The Open Group is
to open another GUI listing projects within that group in a list with
similar options (New Project, Open Project, Rename Project, Delete
Project).

My question is, how should I create all these GUIs? Should each GUI
be its own class with its own __init__? Then is the first GUI the
root (how I have it set up now) and all other GUIs using Toplevel()?

I hope this makes sense (because it only sort of makes sense in my
head).

THanks for any suggestions.

Apr 23 '07 #1
10 2051
On Apr 23, 9:52 am, KDawg44 <KDaw...@gmail.comwrote:
Hi,

I am new to Python and am trying to write a little front end to
another application in Python.

What I want is to have a gui pop up listing some items with several
buttons. The guts of the program I am not having any trouble with but
the GUI part I am (or more accurately, the transition between GUI
pieces).

The first GUI that pops up lists some groups in a listbox and gives
the user the choice to create a new group, open a group, rename the
group, or delete the group. The new group and rename group buttons
pop up a dialog gui asking for the name/new name. The Open Group is
to open another GUI listing projects within that group in a list with
similar options (New Project, Open Project, Rename Project, Delete
Project).

My question is, how should I create all these GUIs? Should each GUI
be its own class with its own __init__? Then is the first GUI the
root (how I have it set up now) and all other GUIs using Toplevel()?

I hope this makes sense (because it only sort of makes sense in my
head).

THanks for any suggestions.
Hi,

You should be able to create one main window as "root" and use
standard dialogs for the dialogs you mentioned. As for the "Open
Group" button, you might use a tree widget instead of opening another
window. You could put the tree in a splitter window or something and
it might look nicer. Of course, you can do another window, but it
would be a custom, hand-coded window and NOT a standard dialog. That
would mean that it would indeed be another class with its own
"__init__".

You can set both the standard dialogs and your custom one to
"ShowModal" and then you shouldn't need to use Toplevel().

I am assuming you are using Tkinter for your front-end GUI. You might
also take a gander at wxPython. It has an excellent demo you could
download and it might give you some additional ideas for
implementation: www.wxpython.org .

Mike

Apr 23 '07 #2
On Apr 23, 9:52 am, KDawg44 <KDaw...@gmail.comwrote:
Hi,

I am new to Python and am trying to write a little front end to
another application in Python.

What I want is to have a gui pop up listing some items with several
buttons. The guts of the program I am not having any trouble with but
the GUI part I am (or more accurately, the transition between GUI
pieces).

The first GUI that pops up lists some groups in a listbox and gives
the user the choice to create a new group, open a group, rename the
group, or delete the group. The new group and rename group buttons
pop up a dialog gui asking for the name/new name. The Open Group is
to open another GUI listing projects within that group in a list with
similar options (New Project, Open Project, Rename Project, Delete
Project).

My question is, how should I create all these GUIs? Should each GUI
be its own class with its own __init__? Then is the first GUI the
root (how I have it set up now) and all other GUIs using Toplevel()?

I hope this makes sense (because it only sort of makes sense in my
head).

THanks for any suggestions.
I am assuming you are using Tkinter for your GUI front-end. You should
be able to just use standard dialog boxes for your "new group" and
"rename group" dialogs and a custom hand-coded dialog for the other
one. All three can be called with ShowModal() instead of Toplevel().
And yes, the custom dialog would work best if you made it into a
separate class.

You could also put that information for the GUI that list projects
into a "tree" widget of some sort, maybe with a splitter window. I
haven't had much luck with Tkinter's tree widgets though. PMW and Tix
both have rather poor docs unless you enjoy man pages. You might check
out wxPython instead. It has an excellent demo that is very good at
showing you not only what all it can do, but how it is done: www.wxpython.org.

Good luck!

Mike

Apr 23 '07 #3
On Apr 23, 1:44 pm, kyoso...@gmail.com wrote:
On Apr 23, 9:52 am, KDawg44 <KDaw...@gmail.comwrote:
Hi,
I am new to Python and am trying to write a little front end to
another application in Python.
What I want is to have a gui pop up listing some items with several
buttons. The guts of the program I am not having any trouble with but
the GUI part I am (or more accurately, the transition between GUI
pieces).
The first GUI that pops up lists some groups in a listbox and gives
the user the choice to create a new group, open a group, rename the
group, or delete the group. The new group and rename group buttons
pop up a dialog gui asking for the name/new name. The Open Group is
to open another GUI listing projects within that group in a list with
similar options (New Project, Open Project, Rename Project, Delete
Project).
My question is, how should I create all these GUIs? Should each GUI
be its own class with its own __init__? Then is the first GUI the
root (how I have it set up now) and all other GUIs using Toplevel()?
I hope this makes sense (because it only sort of makes sense in my
head).
THanks for any suggestions.

I am assuming you are using Tkinter for your GUI front-end. You should
be able to just use standard dialog boxes for your "new group" and
"rename group" dialogs and a custom hand-coded dialog for the other
one. All three can be called with ShowModal() instead of Toplevel().
And yes, the custom dialog would work best if you made it into a
separate class.

You could also put that information for the GUI that list projects
into a "tree" widget of some sort, maybe with a splitter window. I
haven't had much luck with Tkinter's tree widgets though. PMW and Tix
both have rather poor docs unless you enjoy man pages. You might check
out wxPython instead. It has an excellent demo that is very good at
showing you not only what all it can do, but how it is done:www.wxpython.org.

Good luck!

Mike
Sorry about the dual posting. This thing isn't posting correctly for
me today.

Mike

Apr 23 '07 #4
On Apr 23, 1:44 pm, kyoso...@gmail.com wrote:
On Apr 23, 9:52 am, KDawg44 <KDaw...@gmail.comwrote:
Hi,
I am new to Python and am trying to write a little front end to
another application in Python.
What I want is to have a gui pop up listing some items with several
buttons. The guts of the program I am not having any trouble with but
the GUI part I am (or more accurately, the transition between GUI
pieces).
The first GUI that pops up lists some groups in a listbox and gives
the user the choice to create a new group, open a group, rename the
group, or delete the group. The new group and rename group buttons
pop up a dialog gui asking for the name/new name. The Open Group is
to open another GUI listing projects within that group in a list with
similar options (New Project, Open Project, Rename Project, Delete
Project).
My question is, how should I create all these GUIs? Should each GUI
be its own class with its own __init__? Then is the first GUI the
root (how I have it set up now) and all other GUIs using Toplevel()?
I hope this makes sense (because it only sort of makes sense in my
head).
THanks for any suggestions.

I am assuming you are using Tkinter for your GUI front-end. You should
be able to just use standard dialog boxes for your "new group" and
"rename group" dialogs and a custom hand-coded dialog for the other
one. All three can be called with ShowModal() instead of Toplevel().
And yes, the custom dialog would work best if you made it into a
separate class.

You could also put that information for the GUI that list projects
into a "tree" widget of some sort, maybe with a splitter window. I
haven't had much luck with Tkinter's tree widgets though. PMW and Tix
both have rather poor docs unless you enjoy man pages. You might check
out wxPython instead. It has an excellent demo that is very good at
showing you not only what all it can do, but how it is done:www.wxpython.org.

Good luck!

Mike
Thanks very much for your suggestions. I think i will look into
wxPython, though I will finish this little app in tkinter since I am
almost done with it.

THanks for your help.

Apr 23 '07 #5
On Apr 23, 12:26 pm, kyoso...@gmail.com wrote:
I am assuming you are using Tkinter for your front-end GUI. You might
also take a gander at wxPython. It has an excellent demo you could
download and it might give you some additional ideas for
implementation:www.wxpython.org.

Mike
Hi,

I've heard about that excellent demo, but I downloaded wxPython, and I
don't even know where to look for it. Any pointers?
Apr 23 '07 #6
On Apr 23, 4:25 pm, 7stud <bbxx789_0...@yahoo.comwrote:
On Apr 23, 12:26 pm, kyoso...@gmail.com wrote:
I am assuming you are using Tkinter for your front-end GUI. You might
also take a gander at wxPython. It has an excellent demo you could
download and it might give you some additional ideas for
implementation:www.wxpython.org.
Mike

Hi,

I've heard about that excellent demo, but I downloaded wxPython, and I
don't even know where to look for it. Any pointers?
Never mind. Got it:

$ python /Developer/Examples/wxWidgets/wxPython/demo/demo.py

Apr 23 '07 #7
Uhhmm...how are you supposed to close a ShapedWindow(under
Miscellaneous)?

Apr 23 '07 #8
Hello

I was a python newbie just a month ago and found the following books a great
help.

Beginning Python: From Novice to Professional (Beginning: From Novice to
Professional) by Magnus L. Hetland (Paperback - 29 Sep 2005)
http://www.amazon.co.uk/Beginning-Py...7369262&sr=8-2

WxPython in Action by Noel Rappin and Robin Dunn (Paperback - 30 Mar 2006)
http://www.amazon.co.uk/WxPython-Act...7369390&sr=8-1

Kevin

On Monday 23 April 2007, 7stud wrote:
Uhhmm...how are you supposed to close a ShapedWindow(under
Miscellaneous)?
Apr 23 '07 #9
On Apr 23, 5:04 pm, Kevin Haynes <kevin.hay...@auxilior.co.ukwrote:
Hello

I was a python newbie just a month ago and found the following books a great
help.

Beginning Python: From Novice to Professional (Beginning: From Novice to
Professional) by Magnus L. Hetland (Paperback - 29 Sep 2005)http://www.amazon.co.uk/Beginning-Py...ional/dp/15905...

WxPython in Action by Noel Rappin and Robin Dunn (Paperback - 30 Mar 2006)http://www.amazon.co.uk/WxPython-Act...1932394621/ref...

Kevin

On Monday 23 April 2007, 7stud wrote:
Uhhmm...how are you supposed to close a ShapedWindow(under
Miscellaneous)?
I am reading both now, and I would not recommend either one. If you
just skim over the examples and don't play with them, you might
mistakenly believe you know what's going on, but if you actually try
the examples and alter them here and there to figure out how things
really work, you will discover all the mistakes and gaps in both
books.
Apr 23 '07 #10
On Apr 23, 6:36 pm, 7stud <bbxx789_0...@yahoo.comwrote:
On Apr 23, 5:04 pm, Kevin Haynes <kevin.hay...@auxilior.co.ukwrote:
Hello
I was a python newbie just a month ago and found the following books a great
help.
Beginning Python: From Novice to Professional (Beginning: From Novice to
Professional) by Magnus L. Hetland (Paperback - 29 Sep 2005)http://www.amazon.co.uk/Beginning-Py...ional/dp/15905...
WxPython in Action by Noel Rappin and Robin Dunn (Paperback - 30 Mar 2006)http://www.amazon.co.uk/WxPython-Act...1932394621/ref...
Kevin
On Monday 23 April 2007, 7stud wrote:
Uhhmm...how are you supposed to close a ShapedWindow(under
Miscellaneous)?

I am reading both now, and I would not recommend either one. If you
just skim over the examples and don't play with them, you might
mistakenly believe you know what's going on, but if you actually try
the examples and alter them here and there to figure out how things
really work, you will discover all the mistakes and gaps in both
books.
Beginning Python is a good reference, but there's not much for
examples, other than the fairly advanced stuff in the back of the
book. "Python Programming for the Absolute Beginner" by Dawson was
much more fun since you get to create games in python. I'm not sure
why you don't like the wxPython one. It was a nice reference. But
maybe I liked it as I started out learning C++ and wxPython has
similar idioms.

If you want to learn the nuts and bolts of the Python language, you'll
need to read "Programming Python" by Lutz or the really in-depth book
"Core Python Programming" by Chun, which (unfortunately) has lots of
info, but not much code.

The current wxPython demo is here: http://wxpython.org/download.php
(about a third of the way down)

Mike

Apr 24 '07 #11

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

Similar topics

6
by: post400 | last post by:
Hi , I was just wondering ( yeah I know it's not the first time this question pops up ) what would be the best 2 or 3 books for someone who wants to learn Python , already experienced in other...
4
by: Ray | last post by:
I want to jump in a learn Python. I have spent about a day looking at editors and IDEs and (probably prematurely) selected jEdit to work in. I have downloaded Python and jEdit. I have been going...
2
by: AnOvercomer02 | last post by:
Hi. What is the best way to learn Python? None of the local schools near me teach any courses on the topic. Thanks. -- Cody Houston AnOvercomer02@webtv.net
5
by: Falc | last post by:
Hi there... I have been looking at learning Python, so far it looks like an absolutely grat language. I am having trouble finding some free resources to learn Python from. I am on windows and...
5
by: AlbaClause | last post by:
I'm just learning Python, and I have a question about os.path.join(dirpath, name) and its use. Simply put, I haven't figured out how to use it. I was looking through the Python reference...
78
by: arnuld | last post by:
hai all, i am standing on a "crossroad to C++". I am here in front of you as i have a problem. i will be brief. Please do not think: "arnuld is sick", i am really struggling & doing hard-work to...
6
by: dogatemycomputer | last post by:
Greetings, A friend of mine dropped off a copy of Sams Teach Yourself Python in 24 Hours published in 2000. I skimmed the first couple of chapters looking for the interpreter version and the...
16
by: John Salerno | last post by:
Just something that crosses my mind every time I delve into "Learning Python" each night. Does anyone see any value in learning Python when you don't need to for school, work, or any other reason?...
7
by: duli | last post by:
Hi: I would like recommendations for books (in any language, not necessarily C++, C, python) which have walkthroughs for developing a big software project ? So starting from inception, problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.