News for hackers. Stuff that matters.
Re:Why Python is Important for You by Luyt on Saturday February 11, 2012 @03:44PM (#3580109)
Yeah, that's fun ;-) I wish there was a

    if main:
        ... # do some processing
instead of having to write:

    if __name__ == "__main__":
        ... # do some processing
That'd make DHH happy, too ;-)
Re:Why Python is Important for You by anthonyb on Saturday February 11, 2012 @04:38PM (#3580254)
I find that the best way to fix this is to write your program as a library, then the part that you're supposed to run as a script which imports and runs it. No __underscore__magic__ required.