[Tutor] easygui question, again

Kent Johnson kent37 at tds.net
Sun Jun 10 21:19:42 CEST 2007


Rafael Bejarano wrote:
> On Jun 10, 2007, at 2:48 AM, Alan Gauld wrote:
>> How/where did you install easygui.py?
> 
> I installed it by copying easygui.py from the downloaded folder,  
> which was on my desktop, into the folder in which the test program is  
> stored. Was that not okay?

That should work if you run from the same directory.

>> Does the easygui test program run OK?
>>   - Kent already asked you this but I don't remember a reply
> 
> No, although no error messages appear, the program does not display  
> dialog boxes. 

Did you run this from Terminal or Smultron? Probably the program is 
displaying an error but you are not seeing it. Running from Terminal is 
the best way to ensure that you see all the program output. Once we see 
an error message we can help find the problem.

Try this:
- Open Terminal (from Applications/Utilities)
- Type
cd '/Volumes/UNTITLED/Programming stuff/My python stuff/'

(or whatever the correct directory is)
- Type
python demo.py

(or whatever you called your demo program)

Copy the output, paste it into an email and send to the list.

Kent
> Here is the demo program I ran:
> 
> from easygui import *
> import sys
> 
> while 1:
> 	msgbox("Hello, world!")
> 
> 	msg ="What is your favorite flavor?"
> 	title = "Ice Cream Survey"
> 	choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"]
> 	choice = choicebox(msg, title, choices)
> 
> 	# note that we convert choice to string, in case
> 	# the user cancelled the choice, and we got None.
> 	msgbox("You chose: " + str(choice), "Survey Result")
> 
> 	msg = "Do you want to continue?"
> 	title = "Please Confirm"
> 	if ccbox(msg, title):     # show a Continue/Cancel dialog
> 		pass  # user chose Continue
> 	else:
> 		sys.exit(0)           # user chose Cancel
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 



More information about the Tutor mailing list