Open explorer on a file

前端 未结 5 2096
北海茫月
北海茫月 2020-11-28 03:21

In Python, how do I jump to a file in the Windows Explorer? I found a solution for jumping to folders:

import subprocess
subprocess.Popen(\'explorer \"C:\\pa         


        
5条回答
  •  情深已故
    2020-11-28 04:12

    From Geoff Chappell's The Windows Explorer Command Line

    import subprocess
    subprocess.Popen(r'explorer /select,"C:\path\of\folder\file"')
    

提交回复
热议问题