wexpect

Running wexpect on windows

落爺英雄遲暮 提交于 2019-12-11 09:45:58
问题 I have installed wexpect on Windows 7. Now, when I am trying to run any command, I am getting the below error. I am using MKS toolkit, so ls is a valid command. >>> import pexpect >>> pexpect.run('ls ') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\winpexpect-1.5-py2.7.egg\pexpect.py", line 219, in run child = spawn(command, maxread=2000, logfile=logfile, cwd=cwd, env=env) File "C:\Python27\lib\site-packages\winpexpect-1.5-py2.7.egg

run an executable using wexpect

折月煮酒 提交于 2019-12-08 02:11:50
问题 I have an executable (evapo.exe) which has to be called with an input file (inputs.prj), usually I do it using windows command prompt by just typing c:\myfiles\evapo inputs.prj (of course both the executable and input file located in myfiles folder) Now I want to be able to do the same thing using python. Other similar questions here on SO suggested to use wexpect since other methods such as subprocess do not work when the executable askes for other informations to run (for my case the