Skip to content

Instantly share code, notes, and snippets.

@thiagorider
Created September 22, 2016 21:23
Show Gist options
  • Select an option

  • Save thiagorider/af58c2aea762ec5fdbd20f903d67fe8f to your computer and use it in GitHub Desktop.

Select an option

Save thiagorider/af58c2aea762ec5fdbd20f903d67fe8f to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
def main():
print("This is the main function")
test()
def test():
print("This is a test")
if __name__ == "__main__": main()
@thiagorider
Copy link
Author

Allow us to define functions after they are called

It allows this only to only be run when this file is called as the main module. It won't run when the module is included in other modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment