Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > askopenfilename filetypes problem

Reply
Thread Tools

askopenfilename filetypes problem

 
 
embirath embirath is offline
Junior Member
Join Date: Jul 2010
Posts: 1
 
      07-02-2010
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
argparse and filetypes Bradley Hintze Python 2 03-22-2011 03:52 PM
parsing directory for certain filetypes royG Python 11 03-11-2008 01:45 PM
tkFileDialog.askopenfilename filetypes problem Justin Straube Python 2 09-27-2006 08:48 PM
Accessing/Dowloading certain filetypes... Brandon ASP General 2 01-18-2006 04:57 PM
Filetypes in email attachments. justin.vanwinkle@gmail.com Python 1 08-25-2005 09:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57