import win32api
# 后台执行 (程序可加文件扩展名exe)
win32api.ShellExecute(0, 'open', 'notepad.exe', '', '', 0)
# 前台打开(扩展名exe可省略)
win32api.ShellExecute(0, 'open', 'notepad', '', '', 1)
# 打开当前目录文件
win32api.ShellExecute(0, 'open', 'notepad.exe', 'config.json', '', 1)
# 打开/xxx/xxx目录文件
win32api.ShellExecute(0, 'open', 'notepad', './xxx/xxx/123.txt', '', 1)
# 打开IE浏览器
win32api.ShellExecute(0, 'open', 'iexplore.exe', '', '', 1)
# 用IE浏览器打开百度网址
win32api.ShellExecute(0, 'open', 'iexplore', 'https://www.baidu.com/', '', 1)
#打开系统附件自带的画图
win32api.ShellExecute(0, 'open', 'mspaint.exe', '', '', 1)