IPython notebook is great for:
Sharing code!
Combining code with text, plots, mathematical expressions, videos, images, and more!
Show-off a bit!
Interactive teaching (live code)
And.. It has great features such as:
tab-completion
syntax highlighting
%-prefixed commands
Many more...
Check out Ipython notebook here: http://ipython.org/notebook.html
<iframe src=http://ipython.org/notebook.html width=1000 height=400></iframe>
You can write text in markdown too!
Check out some markdown basics here: http://nbviewer.ipython.org/url/www.astro.washington.edu/users/vanderplas/Astr599/notebooks/Markdown%20Cells.ipynb!
This code finds the factorial of a series of number in one line:
#this is a terrible and awesome way to do this:
factorial = (lambda k: reduce(int.__mul__, range(1,k+1),1))
map(factorial, range(1,9))
[1, 2, 6, 24, 120, 720, 5040, 40320]
This shows the use of builtin timeit magic using the following %-prefix command:
import random
%timeit a = [random.random() for x in range(1000)]
10000 loops, best of 3: 178 us per loop
The builtin magics include:
Functions that work with code: %run, %edit, etc.
Functions to run code in other languages: %%bash %%perl %%ruby %%javascript, etc.
*See some examples with magic functions here: http://nbviewer.ipython.org/github/ipython/ipython/blob/1.x/examples/notebooks/Cell%20Magics.ipynb.
You can display images stored locally like this:
from IPython.display import display, Image
display(Image(filename='misc-you-dont-say-l.png'))
Or images stored on the web like this:
<img src="http://cdn.alltheragefaces.com/img/faces/large/misc-you-dont-say-l.png" width=300 height=300/>