This series is a part of Club ShowMeDo. Click to learn why you should join our
club with a simple monthly subscription.
We teach Python and all the cool modules
Topics include beginner Python, GUIs, Web and Desktop Apps
Long, specially crafted video tutorials just for you
Club video tutorials extend our normal Free content
Save your time - we've done the research for you
Keep your skills up-to-date
Learn at your own pace, everything you need is shown to you
Over 12 hours of archived material are waiting for you in the club
 Ian Ozsvald
I am the co-founder of ShowMeDo (see http://showmedo.com/about), author of `The Screencasting Handbook <http://thescreencastinghandbook.com>`_ and the founder of the professional screencast production company `ProCasts <http://procasts.co.uk>`_:
.. image:: http://procasts.co.uk/media/procasts_sma ...
Exercise: User Interaction with a Yes/No control and the EnterBox [ID:247] (6/17)
 Ian Ozsvald
I am the co-founder of ShowMeDo (see http://showmedo.com/about), author of `The Screencasting Handbook <http://thescreencastinghandbook.com>`_ and the founder of the professional screencast production ...
Our authors tell us that feedback from you is a big motivator. Please take a few moments to let them know what you think of their work.
(Showmedo is undergoing major changes. To
report any problems viewing the videos please
email us and include
browser and OS specifics. Cheers - Kyran.)
Want to question the user with a dialog? Want to ask for text input? Learn how to do both in this episode, this is a digression from the main theme aimed at teaching you more about easygui's wide selection of user-interface controls.
You'll learn about asking the user for input and also you'll have to think for a moment to write some Python logic.
Created May 2007, running time 4 minutes
# TODO you will need to import easygui first
# use easygui's enterbox to ask for the name from the user
# TODO complete the enterbox line with a statement
# such as 'Please enter your name'
# use easygui's yes/no box to ask a Yes/No question
yesNo = easygui.ynbox(message = "Is "+name+" your name?")
# if "Yes" then we print the name back out
# with easygui a 'Yes' answer is represented as an Integer 1
# which is equivalent to True for Boolean logic
if yesNo == 1: # if 1 then this statement becomes True
print "Yes "+name+" is your name"
# if you press No then print another message
# TODO if "No" then show something
# like "You didn't enter your name, you silly-billy!"
# TIP Just as 1 is True, a 0 represents False
# so you can copy the section of code above and make
# one logic change and rewrite the print message
Are you learning Python? To keep the site running clean and ad-free we've started Club ShowMeDo. The club will allow you access to some special videos we're making to pass on programming skills we consider important to the development and enjoyment of Free Open Source Software (FOSS).
The focus at the moment is on developing with the Python programming language, one of the backbones of the FOSS movement with a huge number of included and third-party libraries.
We welcome feedback and we want to hear your ideas.
Showmedo's development is fairly rapid and bugs will inevitably creep in. If you have any problems please drop us a line using the contact address below. Likewise, any suggestions for improvements to the site are gratefully received.