Can anyone explain what is the necessity of executing whole script when importing. Isn't it enough to just put the module name in the namespace and execute when some function is called? <br><br><div class="gmail_quote">
On Mon, Feb 2, 2009 at 1:36 PM, Stephen Hansen <span dir="ltr"><<a href="mailto:apt.shansen@gmail.com">apt.shansen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> Maybe he can wrap the things he dont need inside<br>
> if __name__ == '__main__':<br>
> check.<br>
<div class="Ih2E3d">> --<br>
> <a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
><br>
<br>
</div>Yeah but he said he doesn't want to modify the file itself-- if he can<br>
modify the file this can all go away readily, yes.<br>
<font color="#888888"><br>
--S<br>
</font><div><div></div><div class="Wj3C7c">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>