12

By default, the IPython shell shows a blank line between inputs:

In [1]: 1 + 1
Out[1]: 2

In [2]: import math

In [3]: math.sqrt(2)
Out[3]: 1.4142135623730951

In [4]: 

Is there any way to configure the IPython shell so that it does not produce a blank line between each command history? This would significantly increase the amount of history I would be able to see on my screen.

1
  • 1
    The magic command hist (short for history) prints input history without blank lines. Commented Feb 28, 2010 at 17:54

3 Answers 3

8

For Mac users, the profile config to permanently edit this can be found in: /Users/(your username)/.ipython/profile_default/ipython_config.py

For linux users, it's probably a nearly identical path, but with /home/ instead of /Users/. Using '~' in the command line will work in either case, (e.g. ~/.ipython/...).

Un-comment line 164 and remove the newline, so it says:

c.TerminalInteractiveShell.separate_in = ''

While this is an old question, it's still relevant for other users (such as myself) who find it via Google, so I wanted to add this answer for Mac & Linux users.

Sign up to request clarification or add additional context in comments.

Comments

5

You can use the --nosep option. e.g.

C:\Python32\Scripts\ipython3.exe --nosep

Comments

4

I'm working on Windows, Alok's excerp didn't differ from the default content of these three lines in my %USERPROFILE%/_ipython/ipythonrc.ini

I rather had to change the line:

separate_in \n

to:

separate_in 0

1 Comment

That works. Or nosep 1, which is a shortcut for separate_in 0, separate_out 0 and separate_out2 0 (the last two are 0 by default anyway).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.