bat-subprocess-Process
# bat?
## start?
set x= "file"
start "Queueing" cmd.exe /k xx.exe %x%
## end
start taskkill /f /im cmd.exe /fi "USERNAME eq ?" /fi "windowtitle eq queue*" /t
# subprocess.run
result = subprocess.run(cmd) # CompletedProcess(args='"', returncode=0) 等待子進(jìn)程結(jié)束
# os.system()
result = os.system(cmd) #子進(jìn)程的執(zhí)行結(jié)果無法影響主進(jìn)程,0 等待子進(jìn)程結(jié)束
result = os.system(start "Queueing" cmd.exe /k xx.exe %x%) 啟動帶標(biāo)題
# subprocess.Popen()
result = subprocess.Popen(cmd) # <Popen: returncode: None args: ''> 開啟子進(jìn)程
result.pid Popen對象的方法
bat / os.system 從cmd啟動x.exe
subprocess / os.system直接調(diào)用外部程序x.exe?
標(biāo)簽: