python - Does Tkinter come with File Dialogs by default? -


i've been reading tkdocs here, looking @ section windows , dialogs. 1 part provided various ways save, open , locate files on hard drive.

from tkinter import filedialog dirname = filedialog.askdirectory() 

after trying 1 however, got following error:

traceback (most recent call last):   file "<pyshell#9>", line 1, in <module>     a()   file "<pyshell#8>", line 2, in     tkinter import filedialog importerror: cannot import name filedialog 

the code provided in docs done python 3. i've modified import on tkinter (uppercase vs lowercase).

my question is:

are filedialogs in tkinter somewhere else, or need online, or not provided @ all? have python 2.7.6.

you need import tkfiledialog tkinter package. refer this

from tkinter import * tkfiledialog import * 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -