如何在Komodo中将python模块加载到一个新的交互式shell中?

时间:2021-10-10 23:43:02

When using PyWin I can easily load a python file into a fresh interactive shell and I find this quite handy for prototyping and other exploratory tasks.

使用PyWin时,我可以轻松地将python文件加载到一个新的交互式shell中,我发现这对于原型设计和其他探索性任务非常方便。

I would like to use Komodo as my python editor, but I haven't found a replacement for PyWin's ability to restart the shell and reload the current module. How can I do this in Komodo?

我想使用Komodo作为我的python编辑器,但我还没有找到替代PyWin重启shell并重新加载当前模块的能力。我怎么能在科莫多做这个?

It is also very important to me that when I reload I get a fresh shell. I would prefer it if my previous interactions are in the shell history, but it is more important to me that the memory be isolated from the previous versions and attempts.

对我而言,当我重装时,我得到一个新鲜的外壳也是非常重要的。如果我以前的交互是在shell历史记录中,我更喜欢它,但对我来说更重要的是内存与以前的版本和尝试是隔离的。

1 个解决方案

#1


5  

I use Komodo Edit, which might be a little less sophisticated than full Komodo.

我使用Komodo Edit,它可能比完整的Komodo稍微复杂一点。

I create a "New Command" with %(python) -i %f as the text of the command. I have this run in a "New Console". I usually have the starting directory as %p, the top of the project directory.

我使用%(python)-i%f创建一个“新命令”作为命令的文本。我在“新控制台”中运行此操作。我通常将起始目录作为%p,项目目录的顶部。

The -i option runs the file and drops into interactive Python.

-i选项运行该文件并放入交互式Python中。

#1


5  

I use Komodo Edit, which might be a little less sophisticated than full Komodo.

我使用Komodo Edit,它可能比完整的Komodo稍微复杂一点。

I create a "New Command" with %(python) -i %f as the text of the command. I have this run in a "New Console". I usually have the starting directory as %p, the top of the project directory.

我使用%(python)-i%f创建一个“新命令”作为命令的文本。我在“新控制台”中运行此操作。我通常将起始目录作为%p,项目目录的顶部。

The -i option runs the file and drops into interactive Python.

-i选项运行该文件并放入交互式Python中。