tkFileDialog.askdirectory root directory ?

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Tue Mar 2 00:38:44 EST 2004


Ringwraith wrote:
> Hello!
> 
> I have the following problem. I use the tkFileDialog.askdirectory dialog to
> allow users of my application to pick some subfolder from 'C:/my_app'
> directory. I use initialdir='C:/my_app' option to set 'C:/my_app' as initial
> directory. But I want my initial directory to be also a root directory, so
> the user cannot pick any directory outside 'C:/my_app'  folder. I have no
> idea how to do it using standard  tkFileDialog.askdirectory. Is that
> possible?
> 
> Thank you in advance for any hints.
> 
> Best wishes,
> 
> Niki
> 
> 

Unles there is a speacial windows extra thingy I don't think you could 
stop the user selecting a directory not below C:/my_app however you can 
at least start the directory selector with that as it's initial 
directory like so:


tkFileDialog.askdirectory(initialdir="C:/my_app")


HTH
Martin




More information about the Python-list mailing list