gtb wrote:

> I often see the following 'if' construct in python code. What does
> this idiom accomplish? What happens if this is not main? How did I get
> here if it is not main?
> ...
> if __name__ == 'main':
>    myQuest('myQuest').Run()

This idiom is for executing the code if you're running the .py directly,
or doing nothing if you're just "import"ing the module. 

Take note, that when you import a module, __name__ gets the module name.

Regards,

-- 
.   Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to