This documentation covers a development version of IPython. The development version may differ significantly from the latest stable release.
This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.
If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).
Automatic Vi prompt stripping¶
When pasting code into IPython, it will strip the leading prompt characters if
there are any. For example, you can paste the following code into the console -
it will still work, even though each line is prefixed with prompts (
In : 2 * 2 == 4 Out: True In : print("This still works as pasted")
Previously, this was not the case for the Vi-mode prompts:
In : [ins] In : 2 * 2 == 4 ...: Out: True ...: File "<ipython-input-1-727bb88eaf33>", line 1 [ins] In : 2 * 2 == 4 ^ SyntaxError: invalid syntax
This is now fixed, and Vi prompt prefixes -
[nav] - are
skipped just as the normal
In would be.
IPython shell can be started in the Vi mode using