newbie with a gui question

N

niekko

I wrote a program for a class and now have to
make a gui for it. I've done several hours of
research and am stuck. Can someone point me
in the right direction, please????

Here's the original program..


#Petty_Cash.py
from Tkinter import *
import time
import string

true = 1
false = 0

class Petty_Cash:
def __init__(self, initial):
self.balance = initial
print "Account created. Your beginning balance is", "$",
self.balance
print time.ctime()

def deposit(self, amt):
self.balance = self.balance + amt
print "$", + amt, "has been deposited to your account."
print "Your new balance is", self.balance
print time.ctime()

def withdraw(self, amt):
if self.balance >= amt:
self.balance = self.balance - amt
print "$",- amt, "has been withdrawn from your account."
print "Your new balance is", "$", self.balance
print time.ctime()
else:
print "Insufficient funds in account to withdraw", "$", amt
print "Please ensure sufficient funds exist for withdrawl
amount"
print "Your current balance is", "$", self.balance
print time.ctime()

def getbalance(self):
print time.ctime()
return self.balance
 
B

Ben Finney

I wrote a program for a class and now have to make a gui for it. I've
done several hours of research and am stuck. Can someone point me in
the right direction, please????

Possibly the course material? I'd expect that your assignment is to
employ the methods that have been taught to you.
 
N

niekko

That's just it, the course material is "go out and find
it on the 'net." I've got several books on Python and none of them help
will building this gui.

Can someone get me started, at least??
 
B

Ben Finney

On Tue, 3 Feb 2004 18:34:02 -0900, niekko wrote:

(corrected your top-posting; please don't do it.)
That's just it, the course material is "go out and find it on the
'net." I've got several books on Python and none of them help will
building this gui.

Sounds like a bit of a cop-out (on the part of your school); there are
many ways to build a GUI for Python applications.
Can someone get me started, at least??

Python has, for a long time, come with the Tkinter module, allowing you
to build GUIs with the cross-platform Tk toolkit.

<http://www.python.org/topics/tkinter/>

However, Tk widgets are fairly ugly and primitive; a very popular
alternative is wxPython, which uses to the cross-platform wxWindows
toolkit.

<http://www.wxpython.org/>
 
J

Josiah Carlson

That's just it, the course material is "go out and find
it on the 'net." I've got several books on Python and none of them help
will building this gui.

Can someone get me started, at least??

1. Go to www.wxpython.org
2. Download wxPython
3. Follow the examples given here:
http://wiki.wxpython.org/index.cgi/Getting_20Started#head-bc009992ceb90dddb7eb3db953e25d1792da2cdd
4. When you get stuck, read the included documentation (wx.chm) and
check out the included wxPython demo (both are included with the base
distribution).

- Josiah
 
C

Cameron Laird

.
.
.
However, Tk widgets are fairly ugly and primitive; a very popular
alternative is wxPython, which uses to the cross-platform wxWindows
toolkit.
.
.
.
Put a qualifier, like "some", in there somewhere, please;
Tkinter's Text and Canvas widgets are positive powerhouses,
arguably unmatched by any other general-purpose GUI toolkit.
I recognize that Tk widgets present several ... challenges,
though.
 
M

marvin

niekko said:
I wrote a program for a class and now have to
make a gui for it. I've done several hours of
research and am stuck. Can someone point me
in the right direction, please????

Here's the original program..


#Petty_Cash.py
from Tkinter import *
import time
import string

true = 1
false = 0

class Petty_Cash:
def __init__(self, initial):
self.balance = initial
print "Account created. Your beginning balance is", "$",
self.balance
print time.ctime()

def deposit(self, amt):
self.balance = self.balance + amt
print "$", + amt, "has been deposited to your account."
print "Your new balance is", self.balance
print time.ctime()

def withdraw(self, amt):
if self.balance >= amt:
self.balance = self.balance - amt
print "$",- amt, "has been withdrawn from your account."
print "Your new balance is", "$", self.balance
print time.ctime()
else:
print "Insufficient funds in account to withdraw", "$", amt
print "Please ensure sufficient funds exist for withdrawl
amount"
print "Your current balance is", "$", self.balance
print time.ctime()

def getbalance(self):
print time.ctime()
return self.balance


hi-
why not give this a try. i never tried it myself.
it claims to be really easy ...function
driven. . what the hell is lamda anyways?
sounds like some kind of greek organization.


http://www.ferg.org/easygui/index.html

if this is a series of programs that you will be doing
and fancy events are going to be needed you will have to look
at something like tkinter or wxpython when it gets more
advanced.

this class is interesting.

we had an exercise with an elevator. our teacher said if we made
an error we'd send the elevator through the roof like the cartoons :)

have fun!

later,
marvin
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,503
Latest member
supremedee

Latest Threads

Top