我已经创建了一个批处理windows批处理文件。批处理文件运行测试.exe. 我用过子流程.popen使用python运行批处理文件。批处理文件在另一个窗口中运行,批处理文件在另一个窗口中运行测试.exe. 这个测试.exe批处理文件在不同的窗口中运行时会显示“按任意键继续”。我可以用python传递击键吗
import subprocess
subprocess.Popen(r'start cmd /c C:\test.bat', shell=True)
p.wait()
print 'done'
Tags:
Python不能直接满足您的需求,但是Windows包含了您所需要的一切,并且可以通过标准库的ctypes模块从Python获得WinAPI函数。你知道吗
您需要:
根据批处理的启动方式,并假设安装了标准的Windows,应该可以做到以下几点:
相关问题 更多 >
编程相关推荐