[wxPython-users] RE: How to open an explorer window?
Robert Dailey
rcdailey at gmail.com
Wed Aug 1 08:28:48 PDT 2007
The suggestions here so far I like better than nothing, at least the code is
somewhat clean. Thanks a lot guys.
On 8/1/07, Chris Mellon <arkanes at gmail.com> wrote:
>
> On 8/1/07, Mike Driscoll <mdriscoll at co.marshall.ia.us> wrote:
> >
> >
> > > -----Original Message-----
> > > From: Robert Dailey [mailto:rcdailey at gmail.com]
> > > Sent: Tuesday, July 31, 2007 4:51 PM
> > > To: wxPython
> > > Subject: How to open an explorer window?
> > >
> > > 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.
> > >
> > >
> >
> > This probably isn't a wxPython thing. I don't know if you can select a
> > file, but do open Windows Explorer to a specific directory, all you need
> > to do is use the subprocess module's Popen method.
> >
> > subprocess.Popen('explorer c:\\some\\path')
> >
> > I suppose you could use SendKeys to select a text file, but that's
> pretty
> > hackish.
> >
> > Mike
> >
>
> subprocess.Popen('explorer /select,c:\\path\\to\\file.py')
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200708=
01/b6ce18a7/attachment.htm
More information about the wxpython-users
mailing list