使用start_IPython()配置IPython

2024-09-27 19:13:47 发布

您现在位置:Python中文网/ 问答频道 /正文

当我使用一个普通的pythonshell时(我希望这个术语是可以理解的),然后输入

import IPython
IPython.start_ipython(["--pylab=qt", "--TerminalInteractiveShell.editor=scite"])

ipython控制台的启动方式如下

^{pr2}$

但是当我在一个已经运行的ipython控制台上做同样的操作时,这就不起作用了。是否可以“重置”正在运行的ipython控制台?在

编辑:我现在用自己的代码解决了我的问题。当然,在这里展示我的代码对任何人都没有帮助。在给出的答案上(谢谢!):键入

%pylab qt, %
%config TerminalInteractiveShell.editor='scite'

不会抛出错误消息。但它与

ipython --pylab=qt --TerminalInteractiveShell.editor='scite'

行为不同,我的GUI只有在后一种情况下才有响应。我不知道为什么。在


Tags: 代码importipython方式qtstarteditor重置
1条回答
网友
1楼 · 发布于 2024-09-27 19:13:47

有一个IPython magic命令%reset,它将清除所有变量。在

您可以使用%reset?查看更多详细信息和docstring:

Resets the namespace by removing all names defined by the user, if called without arguments, or by removing some types of objects, such as everything currently in IPython's In[] and Out[] containers (see the parameters for details).

相关问题 更多 >

    热门问题