Écrire une sortie de cellule pour fichier Jupyter Colab

%%capture cap --no-stderr
print_something()

with open('/path/to/capture.txt') as f:
    f.write(cap.stdout)
Lazy Lizard