Output cetak sel notebook untuk file

%%capture cap --no-stderr
print 'stuff'
with open('output.txt', 'w') as f:
    f.write(cap.stdout)
Calm Coyote