简体   繁体   中英

Unable to spawn a python shell using winpexpect

I'm trying to spawn a python process using winpexpect, but test = winpexpect.winspawn('python.exe') is failing to do so. The command itself does not throw an error, but when I try test.expect('>>>') the process is timing out.

This behavior is not observed when I try to spawn a cmd.exe or some other process.

Can a python process be spawned using winpexpect? Am I doing some thing wrong?

PS: Python path is added to my PATH environment variable

正如塞巴斯蒂安(Sebastian)所建议的那样,将过程强制为交互模式很有帮助。

test = winpexpect.winspawn('python.exe -i')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM