1import subprocess
2subprocess.Popen(r'explorer /select,"C:\path\of\folder\file"')
1import os
2import subprocess
3FILEBROWSER_PATH = os.path.join(os.getenv('WINDIR'), 'explorer.exe')
4
5def explore(path):
6 # explorer would choke on forward slashes
7 path = os.path.normpath(path)
8
9 if os.path.isdir(path):
10 subprocess.run([FILEBROWSER_PATH, path])
11 elif os.path.isfile(path):
12 subprocess.run([FILEBROWSER_PATH, '/select,', os.path.normpath(path)])
1import sys
2path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
3sys.path.append(path)
4
5import subprocess
6subprocess.Popen('explorer "C:\temp"')
1import webbrowser
2
3path = "C:/Users/Username/PycharmProjects"
4webbrowser.open(path) # Opens 'PycharmProjects' folder.