小编shb*_*shb的帖子

在IPython 7.0.1中打破了多行编辑

我在zsh shell中使用IPython并且我在定义具有多行的函数时遇到了麻烦.

例如,在原始的Python shell中,我可以像这样定义一个函数f:

>>> def f(x):
...     a = x + 1
...     return a
... 
>>>
Run Code Online (Sandbox Code Playgroud)

当我在IPython中完成它时,当'a = x + 1'行结束时,defination立即结束.它看起来像这样:

In [4]: def f(x): 
   ...:     a = x + 1                                                                                                                              

In [5]:   
Run Code Online (Sandbox Code Playgroud)

如何通过更改某些配置或安装其他版本的IPy来修复它?

我的Python和IPython版本:

Python 3.5.6 |Anaconda, Inc.|  
Type 'copyright', 'credits' or 'license' for more information
IPython 7.0.1 -- An enhanced Interactive Python. Type '?' for help.
Run Code Online (Sandbox Code Playgroud)

python shell ipython

4
推荐指数
1
解决办法
435
查看次数

标签 统计

ipython ×1

python ×1

shell ×1