if my stdout is empty re-direct the sterror to text file python code example Example: redirect python output to file $ python foo.py > file