0

How do I make an easygui Multienterbox with all of the questions below in one window?

namegui = easygui.enterbox(msg='Enter your name', title='Name query', default='Gian')
baigui = easygui.enterbox(msg='Enter your BAI', title='Burns Anxiety Inventory query', default='Gian')
bdcgui = easygui.enterbox(msg='Enter your BDC', title='Burns Depression Checklist query', default='Gian')
yeargui = easygui.enterbox(msg='Enter the current year', title='Current Year', default='2011')
monthgui = easygui.enterbox(msg='Enter the current month', title='Current Month')
daygui = easygui.enterbox(msg='Enter the current day', title='Current Day')
time_hourgui = easygui.enterbox(msg='Enter the current hour', title='Current Hour')
time_minutegui = easygui.enterbox(msg='Please enter current minutes', title='Current Minute')                                
am_pmgui = easygui.enterbox(msg='Please enter either am or pm', title='AM OR PM')

I am using Python 2.5.1 on Mac OS X Snow Leopard(10.6).

mu is too short
  • 426,620
  • 70
  • 833
  • 800
gian848396
  • 459
  • 1
  • 8
  • 24

2 Answers2

2

The EasyGui Tutorial has a section on using multienterbox. You an put all of your field names in a list (fieldNames = ['Name query','Burns Anxiety inventory query',...]) and pass it to multienterbox along with a window title (title) and a message (msg):

fieldValues = multenterbox(msg,title, fieldNames)

If you still need the values in individual fields, you could then unpack your tuple:

# include one variable name for each value in fieldValues
namegui, baigui, bdcgui = fieldValues
technomalogical
  • 2,982
  • 2
  • 26
  • 43
  • (fieldNames= ['Year','Month','Day','Time Hour','Time Minute', 'AM or PM']) log = easygui.multenterbox(msg='Fill in the blanks',title='log', fieldNames) – gian848396 Oct 27 '11 at 01:21
  • That is my best attempt at a working multienterbox. Would u please help make a working example? – gian848396 Oct 27 '11 at 01:49
1

Here is the working example

def GetNameconfig():
   name = "TestInputValue"
   return name


defaultName = GetNameconfig()
msg = "Enter your personal information"
title = "Credit Card Application"
fieldNames = ["Name","Street Address","City","State","ZipCode"]
fieldValues = [defaultName, "Hauptstr. 1", "", "Germany", ""]
box = eg.multenterbox(msg,title, fieldNames, fieldValues)
print("Reply was: %s" % str(fieldValues))
Nithish
  • 53
  • 1
  • 14