osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

if STREAM.isatty():


On 29/08/2019 16:29, Hongyi Zhao wrote:
> On Thu, 29 Aug 2019 14:51:43 +0100, Rhodri James wrote:
> 
>> When the stream isn't connected to an interactive terminal, obviously.
>> For example, when it's writing to file.
> 
> But I cannot see any thing like this in the code.

I don't understand what's to not to understand.

   if condition:
     do_something_because_condition_is_true()
   else:
     do_something_because_condition_is_false()

is a perfectly normal construction.  If you mean something else, please 
be explicit.


-- 
Rhodri James *-* Kynesim Ltd