开发者

can winpexpect get the same result with subprocess?

开发者 https://www.devze.com 2023-03-13 01:34 出处:网络
I want to communicate with the subprocess on Windows, and I find winpexpect is one way can help to comp开发者_StackOverflow社区lete the task. The codes is as following

I want to communicate with the subprocess on Windows, and I find winpexpect is one way can help to comp开发者_StackOverflow社区lete the task. The codes is as following

>>> import winpexpect
>>> subproc=winpexpect.winspawn('python')
>>> subproc.expect('>>>')

and a TimeOut exception is raised. Can someone give me some advices?

>>>import subprocess
>>>subproc=subprocess.Popen('python')

codes using subprocess can really start python program, however winpexpect doesn't seem to start

0

精彩评论

暂无评论...
验证码 换一张
取 消