Skip to content

Instantly share code, notes, and snippets.

@nemec
Last active December 8, 2022 08:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nemec/590fda9422e6203bbd6263c5b8ce93df to your computer and use it in GitHub Desktop.
@main
def __main__():
print("hello world")
# put this file at ~/.local/lib/python3.10/site-packages/usercustomize.py
def launch(f):
import inspect
module = inspect.getmodule(f)
if module is not None and module.__name__ == '__main__':
import atexit
atexit.register(f)
__builtins__['main'] = launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment