I\'ve searched and I can only find questions about the other way around: writing stdin to a file :)
Is there a quick and easy way to dump the contents of a file to s
To improve on @bgporter's answer, with Python-3 you will probably want to operate on bytes instead of needlessly converting things to utf-8:
>>> import shutil >>> import sys >>> with open("test.txt", "rb") as f: ... shutil.copyfileobj(f, sys.stdout.buffer)