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?

  • kinther@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    5 days ago

    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.