Determining if stdout for a Python process is redirected
<p>I've noticed that curl can tell whether or not I'm redirecting its output (in which case it puts up a progress bar).</p>

<p>Is there a reasonable way to do this in a Python script?  So: </p>

<p>$ python my_script.py<br />
Not redirected</p>

<p>$ python my_script.py > output.txt<br />
Redirected!</p>
