Zapisz wyjście komórki do pliku Jupyter Colab

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

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