Skip to content Skip to sidebar Skip to footer

"tkinter Tclerror: Bad File Type" Using Askopenfilename

This is my first time using Tkinter. I've imported it and it has been working up until this point. There's seems to be something wrong with the file type? I'm on a Mac as well if t

Solution 1:

filetypes=(("Mp3 Files", "*.mp3")) is equivalent to filetypes=("Mp3 Files", "*.mp3"). I'm guessing you intended for the outer parentheses pair to be a tuple, but that requires a trailing comma. Or you can just use a list.

self.fname = askopenfilename(filetypes=(("Mp3 Files", "*.mp3"),))

Or

self.fname = askopenfilename(filetypes=[("Mp3 Files", "*.mp3")])

Post a Comment for ""tkinter Tclerror: Bad File Type" Using Askopenfilename"