When operation is not specified or 'open', this acts like double-clicking the file in Windows Explorer, or giving the file name as an argument to the start command from the interactive command shell: the file is opened with whatever application (if any) its extension is associated.
无意中发现了这个问题:在同一个目录下多次打开资源管理器,这与您想要的完全相反。在
来自文档
os.startfile
所以就这么做
os.startfile(path)
或者
os.startfile(path, 'open')
只要打开的资源管理器仍在您开始使用的目录中,就可以执行您想要的操作。我不知道我是不是正确的,因为我的答案是假设你在win7操作系统上,使用的是python2.7。在
相关问题 更多 >
编程相关推荐