我想启动一个批处理文件,并使用python将命令发送到该命令行。
我尝试了os模块,但只打开了Windows命令行。
例如:
import os
os.system('cmd')
// and now in pseudo-code:
cd to directory
run batch file
send commands to that command line
答案 0 :(得分:0)
像这样使用subprocess
模块:
import subprocess
subprocess.Popen("Your command here", shell=True)