I have a wxPython 3.0.2.0 application that runs excellently under Windows 7. I need to add a function that opens a Windows folder, but only if that Windows folder has not been opened yet (to avoid multiple copies of the same folder).
Hence the question: is there a python facility (native or via a python library) that can tell me if - in my case - a folder is open in Windows Explorer?
I know there are specific utilities (e.g. handle.exe) that can do this, but would prefer not to deal with extra executables.
R. Miranda wrote:
I need to add a function that opens a Windows folder, but only if
that Windows folder has not been opened yet (to avoid multiple copies
of the same folder).
On my system at least, if you use os.startfile to open the folder in
Windows Explorer and the folder is already open, the existing window
will be focused rather than a new one being launched. This behaviour
probably depends on a setting somewhere or other, though.
···
--
James Scholes
http://twitter.com/JamesScholes
James, that did the trick, thanks for your reply.
···
On Tuesday, November 15, 2016 at 8:33:16 AM UTC+1, R. Miranda wrote:
I have a wxPython 3.0.2.0 application that runs excellently under Windows 7. I need to add a function that opens a Windows folder, but only if that Windows folder has not been opened yet (to avoid multiple copies of the same folder).
Hence the question: is there a python facility (native or via a python library) that can tell me if - in my case - a folder is open in Windows Explorer?
I know there are specific utilities (e.g. handle.exe) that can do this, but would prefer not to deal with extra executables.