Directory chooser in Tk

Randall Hopper aa8vb at yahoo.com
Tue Nov 16 07:19:17 EST 1999


Ivan Van Laningham:
 |I need a dialog similar to the askopenfilename() dialog, but for
 |directories.  Is there such a beast?

There is a tk_chooseDirectory function in Tcl 8.2 (and in but undoc in
8.1), but reportedly this is Win32-only.

Christopher Nelson posted a proposed portable version of this
(chooseDir.tcl) to c.l.tcl last week.  There's also Daniel Roche's
tkgetdir.tcl.

A link to these posts along with a few others from DejaNews:

   http://www.deja.com/=dnc/[ST_rn=ps]/getdoc.xp?AN=547570099
   http://www.deja.com/=dnc/[ST_rn=ps]/getdoc.xp?AN=548332092
   http://www.deja.com/=dnc/[ST_rn=ps]/getdoc.xp?AN=532357262

Shouldn't be hard to port one to Python/Tkinter.  Alternatively, you could
modify the FileDialog.py module in the standard python dist to choose
directories.

-- 
Randall Hopper
aa8vb at yahoo.com




More information about the Python-list mailing list