if STREAM.isatty():

Hongyi Zhao hongyi.zhao at gmail.com
Fri Aug 30 06:56:45 EDT 2019


On Fri, 30 Aug 2019 17:53:02 +1000, Chris Angelico wrote:

> That's because sys.stderr is never changing in your example here. Try
> checking whether sys.stdout is a TTY instead.

OMG, thanks a lot, this does the trick.

> 
> (Also, why the sleep? Seems unnecessary.)

Because without using sleep, the stuff on screen will display very 
shortly and then disappear.  Is this not your testing result? 




More information about the Python-list mailing list