Christian Witts wrote:

    if child.exitstatus and child.exitstatus == 0:
        success = True
    else:
        success = False


There is never any need to write Python code that looks like that. (Or in any other language I'm familiar with either.) Anything of the form:


if some_condition:
    flag = True
else:
    flag = False

is better written as:

flag = some_condition

In the above example, you should write:

success = child.exitstatus and child.exitstatus == 0


except that I think you have the condition wrong... if exitstatus is zero, you get False and True => False, but if exitstatus is non-zero, you get True and False => False. So you will always get success = False.




--
Steven
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to