This file contains 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
@main | |
def __main__(): | |
print("hello world") |
This file contains 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
# 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