Python: How to open a folder on Windows Explorer(Python 3.6.2, Windows 10)
I found a simple method.
import os
path = "C:/Users"
path = os.path.realpath(path)
os.startfile(path)
Other alternatives
import webbrowser, os
path="C:/Users"
webbrowser.open(os.path.realpath(path))
or with os alone
import os
os.system(f'start {os.path.realpath(path)}')
or subprocess
import subprocess,os
subprocess.Popen(f'explorer {os.path.realpath(path)}')
or
subprocess.run(['explorer', os.path.realpath(path)])
Cross platform:
import webbrowser
path = 'C:/Users'
webbrowser.open('file:///' + path)