%%file no_blank.txt line 1 line 2 !cat no_blank.txt %%file with_blank.txt line 1 line 2 !cat with_blank.txt %%file py_with_blank.py print 'spam' print 'ham' !cat py_with_blank.py import IPython import os install_dir = os.path.split(IPython.__file__)[0] cwd = %pwd %cd -q $install_dir !git branch %cd -q $cwd