我正在使用EasyGUI作为我正在编写的一个小程序的一部分。在它中,我使用的是IntegerBox“函数”。在
此函数的部分参数是下限和上限(输入值的限制)。如果该值低于下限值或超过上限值,则程序将引发错误。在
只有在这个程序中,我想删除下界/上界,这样就可以输入任何数字。在
我的代码是:
import easygui as eg
numMin=eg.integerbox(msg="What is the minimum value of the numbers?"
, title="Random Number Generator"
, default=0
, lowerbound=
, upperbound=
, image=None
, root=None
)
我还没有输入任何东西,因为我不知道该放什么。如有任何意见,我们将不胜感激。谢谢!在
当所有其他方法都失败时,尝试读取文档(也就是说,如果有的话;-)。在
EasyGui有一个单独的下载文件
easygui-docs-0.97.zip
,显示在webpage上。下面是它在integerbox()
函数的API部分中所说的:因此,为了回答您的问题,no,似乎没有一种方法可以禁用对模块
integerbox()
所做的边界检查。在更新:这里有一个新函数可以添加到模块中,该函数根本不进行边界检查,也不接受边界参数(因此它与普通版本不严格调用兼容)。如果将其放入,请确保将其名称
'integerbox2'
添加到模块脚本文件顶部附近的__all__
列表的定义中。在如果您希望最小化对
easygui
模块脚本本身的更改,以防将来有更新,您可以将新函数放在一个单独的.py
文件中,然后在easygui.py
顶部附近添加一个import integerbox2
(加上另一行将其添加到__all__
)中。在以下是附加功能:
相关问题 更多 >
编程相关推荐