Why does this launch an infinite loop of new processes?

Andrew Berg bahamutzero8825 at gmail.com
Wed Dec 21 15:11:03 EST 2011


On 12/21/2011 1:29 PM, Ethan Furman wrote:
> Anything that runs at import time should be protected by the `if 
> __name__ == '__main__'` idiom as the children will import the __main__ 
> module.
So the child imports the parent and runs the spawn code again? That
makes sense.

-- 
CPython 3.2.2 | Windows NT 6.1.7601.17640 | Thunderbird 7.0



More information about the Python-list mailing list