Reputation: 2667
Consider the ipython repl:
$ ipython
Python 3.6.8 (default, Aug 7 2019, 17:28:10)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
[ins] In [1]: x = 2
[ins] In [2]: y = 2
[ins] In [3]:
In contrast, consider the normal python repl:
$ python
Python 3.6.8 (default, Aug 7 2019, 17:28:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 2
>>> y = 2
>>>
As you can see, ipython repl adds a lot of unnecessary (my opinion) new line statements, while the python repl is a lot more concise.
Is there a way in which I can disable those new lines? (Note that I am aware of this: https://ipython.readthedocs.io/en/stable/config/details.html where one can change what gets displayed on prompt. However, I can't find an option to disable the new lines in between prompts)
Upvotes: 1
Views: 77
Reputation: 19310
Start ipython
with the --nosep
option.
$ ipython --nosep
Python 3.8.3 | packaged by conda-forge | (default, Jun 1 2020, 17:43:00)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: x = 1
In [2]: y = 2
In [3]: print(x, y)
1 2
In [4]:
From ipython --help
:
--nosep
Eliminate all spacing between prompts.
One can also achieve this behavior by setting this configuration option:
c.InteractiveShell.separate_in = ''
Upvotes: 3