执行后与程序交互 [英] Interacting with program after execution

查看:118
本文介绍了执行后与程序交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PyCharm中,运行脚本后它会自动杀死它:

In PyCharm, after I run a script it automatically kills it:


C:\ Users \Sean.virtualenvs \ Stanley \Scripts\python.exe C:/Users/Sean/PycharmProjects/Stanley/Stanley.py

C:\Users\Sean.virtualenvs\Stanley\Scripts\python.exe C:/Users/Sean/PycharmProjects/Stanley/Stanley.py

完成退出代码0的流程

如何在脚本启动后与脚本进行交互?由于没有更好的方式来表达它,我怎样才能得到

How can I interact with the script after it starts? For lack of a better way to phrase it, how can I get the


>>>

>>>

提示?


  • PyCharm Community Edition 3.0

  • Windows 7

  • Python 2.7

推荐答案

UPDATE

从版本4.0开始,在运行|编辑配置...中编辑运行/调试配置时,有一个选项显示命令行 的。

UPDATE
Starting with version 4.0 there's an option Show command line afterwards when editing run/debug configuration in Run|Edit Configurations....

python的输出--help


-i:运行脚本后以交互方式检查;如果stdin似乎不是终端,则强制提示甚至
;还有PYTHONINSPECT = x

-i : inspect interactively after running script; forces a prompt even if stdin does not appear to be a terminal; also PYTHONINSPECT=x

要在PyCharm中设置解释器选项,请转到运行|编辑配置

To set interpreter option in PyCharm go to Run|Edit Configuration

这篇关于执行后与程序交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆