Python tkinter无法识别的选择器错误
尝试使用Tkinter时出现以下错误:Python tkinter无法识别的选择器错误,python,tkinter,Python,Tkinter,尝试使用Tkinter时出现以下错误: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f80e70137e0' 我在一个类中使用它,代码如下: from Tkinter import * class Interface(): de
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f80e70137e0'
我在一个类中使用它,代码如下:
from Tkinter import *
class Interface():
def __init__(self):
root = Tk()
w = Label(root, text="Hello, world!")
w.pack()
root.mainloop()
正在使用以下代码在单独的文件中调用代码:
from Interface import *
Interface()
我做错了什么?你看过了吗?你做了什么来调试这个?您是否搜索过其他带有短语“NSInvalidArgumentException”的问题和答案?