【问题标题】:EasyGUI- Integerbox OutputEasyGUI-整数框输出
【发布时间】:2012-10-16 21:05:37
【问题描述】:

我刚开始学习 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 之类的,但没有“输出”语法。

关于如何做到这一点的任何想法?

【问题讨论】:

    标签: python easygui


    【解决方案1】:

    不是 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)
    

    【讨论】:

    • 这行得通;我可以为此使用问题的输出。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-21
    • 1970-01-01
    相关资源
    最近更新 更多