The py2tex extension can be found at https://gist.github.com/4032651. The extension defines new magic functions to convert easy python formulas to a nice LaTeX representation.
The extension supports the python unum class to provide unit aware calculation. The combination of ipython notebook with unit aware calculation make it perfect for engineering calculation worksheets.
%load_ext py2tex
from math import *
%%tex a=1.0
b = -1.0
c = -1.0
x_1=(-b+sqrt(b**2-4*a*c))/(2*a)
x_2=(-b-sqrt(b**2-4*a*c))/(2*a)
varphi = x_1
%texnr x_1_2=x_1+x_2
%texformat %.3e
%%tex alpha = pi/3
cos(alpha)**2+sin(alpha)**2
sin(alpha)
from unum.units import *
%texformat %.3f
%%texnr t = 3.0*s
a = 4.5*(m/s**2)
v_0 = 2*(m/s)
%tex x = v_0*t+(a*t**2)/2