开发者

Redirecting existing Windows Explorer instance

I have a program that opens a lot of folders right now, and I am hoping that I can use the already open explorer instances to open new ones. I have this code:

import subproce开发者_开发技巧ss
subprocess.Popen(r'explorer /select,"C:\path\of\folder\file"')

I have seen threads on doing this in C#. Does anyone know a way it can be done in Python?

Thanks,

Ben


I do not believe you can do this. If there is any hope you will probably need to look at Python for .Net, you might give IronPython a try. But the code above using subprocess is simply giving you the same result as if you ran that string in command line. Which launches the explorer application with those arguments. But once its started, its off running on its own. Its not looking for command line input any more. I've looked at the list of command line arguments for explorer, and I see nothing that would indicate you can manipulate it once its running. Sorry, hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜