简体   繁体   English

Pycharm-运行在ipython控制台中选择的运行代码

[英]Pycharm - Run code selected in running ipython console

In Pycharm, you can have a running iPython console after running your script with the "Show command line afterwards" option. 在Pycharm中,使用“之后显示命令行”选项运行脚本后,即可运行iPython控制台。

It is also possible to run the code selected with ALT + SHIFT + E. 也可以运行用ALT + SHIFT + E选择的代码。

But it runs the code in the Python console of Pycharm, not in the iPython console opened when running a script as described above. 但是它在Pycharm的Python控制台中运行代码,而不是在如上所述运行脚本时打开的iPython控制台中运行代码。

Is it possible to run pieces of code likewise in that console were your script was run? 是否可以在运行脚本的那个控制台中同样运行代码?

You have to set the project interpreter to IPython. 您必须将项目解释器设置为IPython。 Then when you execute it with Alt + Shift + E it will run it in IPython. 然后,当您使用Alt + Shift + E执行它时,它将在IPython中运行。

You can view how to set up an interpreter here . 您可以在此处查看如何设置口译员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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