Last active
April 12, 2025 18:06
-
-
Save bigntallmike/4fd3dd235722418de14e92e0146fd6f3 to your computer and use it in GitHub Desktop.
Python beginner tip 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# Instead of just typing: | |
print("hello world") | |
# Do this (main is a placeholder; the actual thing it does is better): | |
def main(): | |
print("hello world") | |
# This will only be called if you run this file directly. | |
# If it is for instance imported by another file, it will not run this: | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment