python how to print to file than stdout code example Example: redirect python output to file $ python foo.py > file