- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
Also, do y’all call main() in the if block or do you just put the code you want to run in the if block?
Also, do y’all call main() in the if block or do you just put the code you want to run in the if block?
Alternative: put entry point code in file
__main__.py
& run the containing package (eg,some_package
) as a top-level expression (eg,python -m some_package
).TIL. Thanks for that!