3 ms·
I understand that what you have is a complete program but every new Pythonist is going to next read the documentation that says, “Having a main method is a real
by jimbob45 6y ago
I understand that what you have is a complete program but every new Pythonist is going to next read the documentation that says, “Having a main method is a really good idea” and go try to implement one. Sure, in 1% of cases, you’ll need the granular control over how main is called but since when do languages cater to the 1%?
- mcintyre1994 6y agoCan't you just put code in `def main` and then have `main()` at the top-level if you don't need to worry about imports? It seems like you can probably get pretty far as a beginner before you need to worry about being able to both import and run the same file.