I like the IPython terminal for all its colors and syntax completion but what I really cannot stand is getting told all the time that this line is an input and the other one right after is an output.
Its an interactive terminal.
I know that the one line is the input and the other line right after is the output.
I just typed those lines in.
Enough ranting IPython has been around for some time now and would not have gotten its superp reputation and wide spread acceptance if there was not a tweak to be made.
Tweaking Ipython involves two pieces:
- Creating a config file.
- Overwriting the default input and output prompts.
Creating a config file is easy, we can ask IPython to do it for us. The follwing line will create a conig file within the users home directory (IPython documentation):
Editing the file we can add the follwing lines which will overwrite the default prompts (see here for source):
from IPython.terminal.prompts import Prompts
from pygments.token import Token
def in_prompt_tokens(self, cli=None):
return [(Token.Prompt, '')]
def out_prompt_tokens(self, cli=None):
return [(Token.Prompt, '## ')]
This will change the IPython terminal output from the default and well known
In : 1
In : 2
… to a more concise and copy and paste friendly format that looks like this: