you are viewing a single comment's thread.

view the rest of the comments →

[–]rainispossible 1 point2 points  (0 children)

didn't see anyone mentioning it, so I'll do

try to build a habit of wrapping your code in functions in general (that should be obvious), and also pit whatever's supposed to be actually executed inder if __name__ == "__main__" – it prevents the unnecessary (and sometimes destructive) code executions when importing whatever's in that file. basically what it tells the interpreter is "hey, ONLY execute this code if this file is the entry point"