Python: execute an external program (zz)

Python 执行外部命令或URL
os.system(command)
wx.Execute(command, syn=wx.EXEC_ASYNC, callback=None)
class subprocess.Popen
webbrowser.open(url)

os.system()与os.popen()比较

os.system
os.popen。。。
os.startfile
os.exec一系列

Python os.system() help
    For some reason os.system() isn't friendly with commands that have spaces in their paths (even if you enclose them with ""). Best practice is to swtich to a slightly more robust execution module such as subprocess (if you're on 2.4 or greater), or popen 

    use raw string in windows

 


 

原文地址:https://www.cnblogs.com/markjiao/p/1531904.html