0
我最近买了一个新的MacBook Pro,我一直在使用它来处理python。 Python已经安装,我的版本是2.7.5。Tkinter不能在Mac上工作
但是tkinter在空闲或崇高的文本上根本不工作!我没有收到任何错误或任何错误,只是当我输入我的代码时什么都没有显示出来!
这是我使用的示例代码:
Python 2.7.5 (default, Sep 2 2013, 05:24:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> from Tkinter import *
>>> tk = Tk()
>>> btn = Button (tk, text = "click me")
>>> btn.pack
<bound method Button.pack_configure of <Tkinter.Button instance at 0x101b4edd0>>
>>> btn.pack()
编辑:我最后什么事做的只是下载蟒蛇空闲(3.3版),从互联网和得到了附带的闲置,现在我只使用它。然而,它并没有针对视网膜进行优化,这使得使用它变得非常痛苦。我只是使用Windows 7来做到这一点。谢谢你的回答,虽然
如果您将该代码放入文件中,请将调用添加到mainloop,然后执行该文件,会发生什么情况? –