if STREAM.isatty():

Cameron Simpson cs at cskk.id.au
Fri Aug 30 18:57:55 EDT 2019


On 30Aug2019 10:25, Michael Torrie <torriem at gmail.com> wrote:
>On Fri, Aug 30, 2019, 05:02 Hongyi Zhao <hongyi.zhao at gmail.com wrote:
>> On Fri, 30 Aug 2019 17:53:02 +1000, Chris Angelico wrote:
>> > (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?
>
>No it is not. What kind of terminal are you using?

Note that testing this stuff in a regular terminal will us the \r 
version. Which leaves the cursor at the left end of the progress 
display. Where it will be overwritten by your prompt, depending on the 
shell.

So what he describes is entirely possible on UNIX.

Cheers,
Cameron Simpson <cs at cskk.id.au>



More information about the Python-list mailing list