I am working with some demo programs in a breezypythongui book. One program contains these two lines:

filetypes = [ ("Python files", "*.py"), ("Text files", "*.txt")]
fileName = tkinter.filedialog.askopenfilename(parent = self,
                   filetypes = filetypes)

According to the book this should open a file dialog and show .py and .txt files, but it only shows .py files. Thinking that maybe it had something to do with the breezypythongui implementation, I opened a terminal and tried:

Python 3.3.5 (default, Mar 12 2014, 02:09:17)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter.filedialog
>>> filetypes = [("Python files", "*.py"), ("Text files", "*.txt")]
>>> fileName = tkinter.filedialog.askopenfilename(filetypes = filetypes)

It pops up a file dialog but again only .py files are shown.

Why is it that both .py and .txt files are not shown? It seems to be the correct way to do it.

Thanks,  Jim

_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to