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…

Advertisements

Entry filed under: Uncategorized.

Automatic security updates on Centos and Redhat Doing horrible things to fix problems in apt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


October 2011
M T W T F S S
« Sep   Nov »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

%d bloggers like this: