[wxPython-users] How to open an explorer window?

Robin Dunn robin at alldunn.com
Wed Aug 1 13:41:59 PDT 2007


Phil Mayes wrote:
> At 02:51 PM 7/31/2007, you wrote:
>> Hi,
>>
>> I currently use wxPython on windows. Is there a way to make an 
>> explorer window open up, displaying the directory that contains a 
>> file? For example, if I have the path 
>> "C:\myfolder\subfolder\file.txt", I want to pass this path into a 
>> function that opens up an explorer window at the folder 
>> "C:\myfolder\subfolder\" with the file " file.txt" highlighted. Is 
>> this possible? I'm not sure if this is a wxPython ability or if the 
>> python libraries support this.
>>
>> Thanks.
> 
> The only way I could find needed to hardwire the location of explorer :-(

You can either count on it being on the PATH, or you can use 
os.environ['SystemRoot'] to find out the name of the dir it is located in.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list