A probable improvement on this would be to leave bash out, and just put a python hash bang in the script directly.
I'll leave implementing it as an exercise to the reader. Personally I have found using Guake (http://guake.org/) with IPython as the shell a very nice way of solving this problem.