- cross-posted to:
- programmer_humor@programming.dev
- programmerhumor@lemmy.ml
- cross-posted to:
- programmer_humor@programming.dev
- 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?
I write a main function that is called by the name in main if block. I understand the reason behind it and also write name in main if blocks for utilities I import (eg utilities.py), which prints usage information to direct the user on how to use things properly.
It doesn’t make sense initially but I’ve gotten used to it. Doesn’t bother me anymore.