Beginner's popups in vanilla Python program

Stephen Ferg steve at ferg.org
Mon Aug 4 08:42:47 EDT 2003


Look at EasyGui:
http://www.ferg.org/easygui/

Here's what your program would look like:
==============================================================
# Program: Beginners_Popups.py ... "Hello World" for popups
from easygui import *

print "Begin program"

# Prepare the basic programmatic messages
strMess1 = "Is this a Test?"
strTitle1 = "Test Query"
strResponse = "You selected "
strTitle2 = "Response:"

boolVar = boolbox(strMess1, strTitle1, ["Yes", "No"])

# Build the appropriate response
if boolVar:
   strResponse += "YES"
else:
   strResponse += "NO"

msgbox(strResponse, strTitle2)  # button is OK
boolbox(strResponse, strTitle2, ["Close"]) # button is Close
print "End of Program"




More information about the Python-list mailing list