IPython ends input of indented blocks after first newline

左心房为你撑大大i 提交于 2019-12-22 11:25:32

问题


In IPython, I can't enter in a multiline indented block; it ends input (switches from the ...: prompt to the next In [x]), as soon as I hit enter.

For example, I'm trying to write an example implementation of Newton's method for a demonstration. I can only write the first line before it returns me to, so all I can type into IPython is this:

In [3]: def newton(x0, fn, epsilon=0.00001):
   ...:     x1 = x0 - fn.evalf(subs={'x': x0}) / fn.diff().evalf(subs={'x': x0})

In [4]:

I'm using Python 3.6.6, IPython 7.0.1, and Ubuntu 18.04.

来源:https://stackoverflow.com/questions/52836676/ipython-ends-input-of-indented-blocks-after-first-newline

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!