2011-10-24 39 views
0

如何在一個窗口中製作一個帶有以下所有問題的easygui Multienterbox?如何製作一個easygui Multi Enter Box?

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') 

我使用Python 2.5.1在Mac OS X雪豹(10.6)。

回答

1

EasyGui Tutorial有一節使用multienterbox。你的把所有的字段名的列表(fieldNames = ['Name query','Burns Anxiety inventory query',...]),並把它傳遞給multienterbox一個窗口標題(title)和消息(msg)沿:

fieldValues = multenterbox(msg,title, fieldNames) 

如果您還需要在各個字段中的值,然後你可以解開你的元組:

# include one variable name for each value in fieldValues 
namegui, baigui, bdcgui = fieldValues 
+0

(FIELDNAMES = [ '年', '月', '日', '時間一小時', '時間分', '上午或下午']) 日誌= easygui.multenterbox(msg ='填入空格',title ='log',fieldNames) – gian848396

+0

這是我在一個可工作的多人框中的最佳嘗試。請你幫忙做一個有效的例子嗎? – gian848396