3

私は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なものですが、「出力」構文はありません。

そうする方法についてのアイデアはありますか?

4

1 に答える 1

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 のドキュメントには、choicebox の同様の例が示されています。

msg ="What is your favorite flavor?"
title = "Ice Cream Survey"
choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"]
choice = choicebox(msg, title, choices)
于 2012-10-09T05:24:19.323 に答える