Monday, November 15, 2021

[Python] Python Main Functions

This article is very useful:

Four best practices to make sure that your code can serve a dual purpose:
  1. Put most code into a function or class.
  2. Use __name__ to control execution of your code.
  3. Create a function called main() to contain the code you want to run.
  4. Call other functions from main().

No comments:

Post a Comment