askopenfilename filetypes problem

Joined
Jul 2, 2010
Messages
1
Reaction score
0
Hi all

I have written a python program which uses the Tkinter function tkFileDialog.askopenfilename . One of the options for this function is "filetypes". I use it this way:

tkFileDialog.askopenfilename ( filetypes = [('Text files','*.txt'),('All files','*')] )

On my Windows machine, it works fine. By default, the file dialog displays only ".txt" files. But the user has the option to display "All" files with a drop-down filetype menu.

But on a Macintosh, only the Text files are displayed in the file dialog, and there is NO option to display "All" file types. The user is then unable to open any files which do NOT have the extension ".txt"

According to documentation I found online, if the platform does not support the "listbox" in the file selection popup, then ALL files would be displayed instead. At least that is how I interpret it:

"if the File types listbox is not supported by the particular platform then all files are listed regardless of their types"

But that's not happening for me. Is this a Tkinter bug? Or do you know what is going on?

Thank You
Emma
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top