Search code examples
google-colaboratory

Streaming output truncated to the last 5000 lines


The Google Colab output is being truncated. I've looked through the settings and I didn't see a limitation there. What is the best option to solve the problem?


Solution

  • I had the same problem and managed it by writing the output on a file on drive:

    from google.colab import drive
    drive.mount('/content/drive')
    import os
    os.chdir("/content/drive/")
    with open('/content/drive/output.txt','w') as out:
       out.write(' abcd \n')