%%file no_blank.txt
line 1
line 2
Overwriting no_blank.txt
!cat no_blank.txt
line 1 line 2
%%file with_blank.txt
line 1
line 2
Overwriting with_blank.txt
!cat with_blank.txt
line 1 line 2
%%file py_with_blank.py
print 'spam'
print 'ham'
Overwriting py_with_blank.py
!cat py_with_blank.py
print 'spam' print 'ham'
For reference, I use the development version of IPython with PR 3203 on top of that
import IPython
import os
install_dir = os.path.split(IPython.__file__)[0]
cwd = %pwd
%cd -q $install_dir
!git branch
%cd -q $cwd
help master * pr/3203