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?

  • VibeCoder [they/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    2
    ·
    3 days ago
    #!/usr/bin/env python
    
    def main() -> None:
        """executes when file is run as a standalone script"""
        print('hello world')
    
    if __name__ == '__main__':
        main()
    

    geordi-no

    print('hello world')
    

    geordi-yes