I'm getting into Python after forgetting my one intro class many moons ago... I call this code
filedialog.askopenfilename(filetypes = (("TCX files","*.tcx"),("All files","*.*"))) # Works
and it works. I decided to only want *.tcx files so I use
filedialog.askopenfilename(filetypes = (("TCX files","*.tcx"))) # Doesn't work
and
filedialog.askopenfilename(filetypes = ("TCX files","*.tcx")) # Doesn't work
and no dice - I get
"bad file type "*.tcx", should be "typeName {extension ?extensions ...?}"
But then I try
filedialog.askopenfilename(filetypes = [("TCX files","*.tcx")]) # Works
and it works. I'm okay with Python wanting lists in square brackets, but is there some good reason why the first line worked at all? Does Python treat one-element lists fundamentally different than N>1? Or maybe it's just tkinter's code - the module (filedialog) can handle polymorphic inputs?