我已经从:http://wiki.python.org/moin/TkInter安装了python3.2。在
第三步-Tkinter有效吗?在
在Python提示符下尝试以下命令:
Tkinter._test() # note underscore in _test. Also, if you are using Python 3.1, try tkinter._test() instead. This should pop up a small window with two buttons.
>>> Tkinter._test
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
Tkinter._test
NameError: name 'Tkinter' is not defined
>>> tkinter._test
<function _test at 0x00000000028FD2C8>
但是,没有“带2个按钮的窗口”。 思想?在
在示例代码中,您在测试后忘记了包括括号。Test实际上是一个函数,因此它需要括号:
使用:
请注意括号-它们在调用函数时是必需的。如果你用参数调用一个函数。在
要测试模块是否已正确导入(这适用于任何模块),请尝试:
^{pr2}$例如:
运行
tkinter._test()
。注意括号。在相关问题 更多 >
编程相关推荐