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]
    link
    fedilink
    English
    106 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