SyntaxFix
Write A Post
Hire A Developer
Questions
If it's a large file and you don't want to consume a ton of memory as might happen with Ben's solution, the extra code in
>>> import shutil >>> import sys >>> with open("test.txt", "r") as f: ... shutil.copyfileobj(f, sys.stdout)
also works.