[Tutor] Python gui for file input

Alan Gauld alan.gauld at btinternet.com
Sat Jan 6 01:29:12 CET 2007


Apologies for the wird formatting, looks like the news reader
got confused by Pythons chevrons and thought it was a thread!
Hopefully spacing will fix it...

"Alan Gauld" <alan.gauld at btinternet.com> wrote

>>> import Tkinter as tk

>>> import tkFileDialog as fd

>>> t = >>>> tk.Tk()

>>> t.withdraw()  # hides the Tk root window''

>>> d = fd.askdirectory() # display the dir dialog

>>> print  d
D:/Development

>>> dir(fd)
['Dialog', 'Directory', 'Open', 'SaveAs', '_Dialog', '__builtins__',
'__doc__','__file__',  '__name__', 'askdirectory', 'askopenfile',
'askopenfilename',  'askoenfilenames', 'askopenfiles', 
'asksaveasfile',
 'asksaveasfilename']





More information about the Tutor mailing list