Making ipython less ugly
October 5, 2011 at 10:38 pm Leave a comment
Ipython is a better shell than the python shell, this much should be clear, it supports:
* Completion
* Better plotting of graphs using matplotlib
* Magic return values for every expression you write _1 etc
* pretty printing by default
However despite this I didn’t use it for a long time, and this was for only one reason: It’s ugly.
To be more specific:
* The initial banner takes up half a screen
* It prints out too many newlines.
Since I appear to be spending this evening yak-shaving, I’ve decided to make ipython less ugly, and therefore just about useable.
=== Making ipython useable ===
==== Removing hideous banner ====
Knowing the version of python you are using is pretty useful in server environment, so we still want this in then banner. We just want want less noise. This is acheived by putting the following executable on your path and using it instead of ipython. (I named it ipy).
It seems like you can modify the banner via options alone.
#!/usr/bin/env python import sys import IPython.Shell IPython.Shell.start().mainloop(banner='IPython %s\n' % sys.version)
===== Making the prompts less ugly ====
You can do this via your ipythonrc file. Just take the newline out of prompt_out
prompt_out ‘Out[\#]: ‘
And there we go a useable shell…
Entry filed under: Uncategorized. Tags: .
Trackback this post | Subscribe to the comments via RSS Feed