EasyGUI-整数盒输出

时间:2012-10-09 00:30:31

标签: python easygui

我刚开始学习Python,在搞乱并创建了我想要使用的程序后,我想为它创建一个GUI。我不知道如何开始,所以我只是查了一下,找到了EasyGUI

我有它的工作和一切,但我如何将答案记录到一个变量?

import easygui as eg
n=0
eg.integerbox(msg="What is the max integer in the Sequence, n?"
              , title="blah blah blah"
              , default=0
              , lowerbound=0)

我想将问题What is the max integer in the Sequence, n?的答案设置为变量(对于此实例,n)。

n=output之类似,但没有“输出”语法。

有关如何操作的任何想法?

1 个答案:

答案 0 :(得分:2)

不是easygui的专家,但我会给它一个刺。

你有没有试过像:

import easygui as eg
uservalue = eg.integerbox(msg="What is the max integer in the sequence, n?"
                  , title = "blah blah blah"
                  , default = 0
                  , lowerbound = 0

easygui文档为选择框提供了类似的示例:

msg ="What is your favorite flavor?"
title = "Ice Cream Survey"
choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"]
choice = choicebox(msg, title, choices)