[Tutor] How to allow user to choose an option from a window

Urban.Landreman at co.hennepin.mn.us Urban.Landreman at co.hennepin.mn.us
Tue Dec 12 17:04:04 CET 2006


I'm trying to allow a user to select one option from a list.

My simple code works:
OptionList = ['One', 'Two', 'Three']
while 1:
  print 'Here are your options:'
  for option in OptionList:
      print option
  optionChosen = raw_input("Which one do you want? ")
  if optionChosen in OptionList:
      break
  print "That is not a valid option.  Please re-enter your choice." 
print "You have chosen: ", optionChosen 

However, Now I'd like to display the options within a MsgBox-type display 
and have the user click on the option of choice.

Any suggestions of a model I can adapt to accomplish this?

Thanks.

Urban Landreman



More information about the Tutor mailing list