Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure IPython 5 to have IPython 3's readline, tab-completion, (lack-of) syntax highlighting, etc? (self.IPython)

I know at some point I may want to "upgrade", but for now I just want the old look & feel back.

I know IPython is very configurable but I'm not having much luck finding the correct settings.

(This only refers to IPython's interactive terminal, by the way)

like image 506
sente Avatar asked Aug 30 '16 11:08

sente


People also ask

Is IPython the same as Python?

IPython is an interactive command-line terminal for Python. It was created by Fernando Perez in 2001. IPython offers an enhanced read-eval-print loop (REPL) environment particularly well adapted to scientific computing. In other words, IPython is a powerful interface to the Python language.

What is IPython shell?

IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language, that offers introspection, rich media, shell syntax, tab completion, and history.


1 Answers

Start by creating a default iPython profile. From your shell, type:

$ ipython profile create

That should give output similar to this, assuming the username someuser:

[ProfileCreate] Generating default config file: u'/home/someuser/.ipython/profile_default/ipython_config.py'

Open the newly created file with your favorite text editor, in the above example shown as: /home/someuser/.ipython/profile_default/ipython_config.py

Add the following lines at the bottom:

c.TerminalInteractiveShell.colors = 'NoColor'
c.TerminalInteractiveShell.display_completions = 'readlinelike'

Save the file.

That should be it. Changes should be active in new iPython sessions.

like image 106
Teekin Avatar answered Oct 26 '22 16:10

Teekin