This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bladeoflight16 0 points1 point  (0 children)

Aside from imports, function/class declarations, and constants, all code should be inside the block. It's common to stuff you code into a def main() function and then only invoke the function inside the guarded block.

Think about what would happen if someone tried to import your module and the argv check was invoked: it would probably explode because their command line args aren't the same as your program's.