tkFileDialog.askopenfilename filetypes problem

Justin Straube JustinStraube at
Wed Jul 13 18:19:12 CEST 2005

Hopefully someone can catch what im missing here. Ive googled this and I think 
Ive got the filetypes arg written properly, but I get a traceback when calling 
this function.

Heres the code followed by its traceback.

def do_ask_fn_1():
     z = askopenfilename(title=TITLE, initialdir=Dst_Dir,
                         filetypes=(('AIFF Files','*.aiff'),
                                    ("AU Files", "*.au"),
                                    ("RAW Files", "*.raw"),
                                    ("SD Files", "*.sd"),
                                    ("SND Files", "*.snd"),
                                    ("WAV files", "*.wav")
     print z

Exception in Tkinter callback
Traceback (most recent call last):
   File "E:\PYTHON~1\lib\lib-tk\", line 1345, in __call__
     return self.func(*args)
   File "P:\work\Python\PYZoid\PYZoid.pyw", line 213, in do_ask_fn_1
     filetypes=[('AIFF Files','*.aiff'),
TypeError: askopenfilename() takes exactly 0 non-keyword arguments (1 given)

Can anyone point to what Ive done wrong? Thanks for any input.


More information about the Python-list mailing list