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

Mariano Di Felice mariano.difelice at gmail.com
Wed Aug 1 01:04:53 PDT 2007


Or you can use the win32api library!

Phil Mayes ha scritto:
> 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 :-(
>
> EXPLORER = 'C:\\windows\\explorer.exe'
> os.spawnl(os.P_NOWAIT, EXPLORER, '.', '/n,/e,/select,"%s"'%mydir)
>
> See http://support.microsoft.com/default.aspx?scid=314853
>
> If anyone knows a cleaner way, I'd love to hear it!
>
> Phil
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>


-- 
/\/\ariano Di Felice
Java PHP Python Ruby programmer
with MySQL, PostgreSql, SQLite and Oracle support
Linux Platform Developer
http://www.marianodifelice.it
mariano.difelice at gmail.com
Tel. 0735 703735
Cell +39 339 6407211




More information about the wxpython-users mailing list