3 ms·
Yeah, that's fun ;-) I wish there was a if main: ... # do some processing instead of having to write: if __name__ == "__main__": ...
by Luyt 15y ago
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 ;-)
- anthonyb 15y agoI 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.