这是我第一次使用Tkinter.我已经导入了它,它一直工作到现在.文件类型似乎有问题?如果这有什么区别的话,我也在Mac电脑上.
这是我的代码:
def importTracks(self):
self.fname = askopenfilename(filetypes=(("Mp3 Files", "*.mp3")))
这是我收到的错误,
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 /Users/accudeveloper/PycharmProjects/AccuAdmin2.0/AccuAdmin2.0.py
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tkinter/__init__.py", line 1533, in __call__
return self.func(*args)
File "/Users/accudeveloper/PycharmProjects/AccuAdmin2.0/AccuAdmin2.0.py", line 68, in importTracks
self.fname = askopenfilename(filetypes=(("Mp3 Files", "*.mp3")))
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tkinter/filedialog.py", line 375, in askopenfilename
return Open(**options).show()
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/tkinter/commondialog.py", line 48, in show
s = w.tk.call(self.command, *w._options(self.options))
_tkinter.TclError: bad file type "*.mp3", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?