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,然後執行該文件,會發生什麼情況? –