Python 打开文件夹(文件浏览器)的3个方法。也可以用于打开本地文件。
工具/原料
python
方法1
#用subprocessimport subprocess# 目录subprocess.Popen(r'explorer 'path'')# 文件subprocess.Popen(r'explorer /select,'file'')
方法2
#用osimport osos.system('start explorer '+ path)
方法3
#用startfilefrom os import startfile# 打开文件夹窗口startfile('path')# 打开文件startfile('file')
下一篇:文件夹打开一层出一个窗口