Skip to content

Instantly share code, notes, and snippets.

@acbart
Created March 24, 2025 23:14
Show Gist options
  • Save acbart/ca120227dc3ff75942a7cec8a08c93eb to your computer and use it in GitHub Desktop.
Save acbart/ca120227dc3ff75942a7cec8a08c93eb to your computer and use it in GitHub Desktop.
Example Python Scripts
python simple_python_utility.py
import simple_python_utility
simple_python_utility.main()
# This file does nothing on its own, if your run or import it.
def do_something():
print("Hello world!")
# A lot of folks like to define a main function
def main():
do_something()
# Because I properly guarded its main
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment