Python program with tee

I ran into problems with Python not piping stdout to tee. The problem was that Python is buffering the stdout. To enable tee to work, you simply need to put a -u flag there.

python -u your_script | tee your_log

Thanks to this post here, really should read the man page of Python more

https://stackoverflow.com/questions/21662783/linux-tee-is-not-working-with-python

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s