[Tutor] Which is better Practice and why

Devin Jeanpierre jeanpierreda at gmail.com
Tue Oct 23 14:11:11 CEST 2012


On Tue, Oct 23, 2012 at 5:59 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> I think you'll find that you're wrong there :)

Oops.

>> If I want to test something, I put it in another file.
> Yes. And how do you import the __main__.py module to test it, without
> it executing?

How do you test the body of code in the "if __name__ == '__main__'"
block, without it executing?

-- Devin


More information about the Tutor mailing list