Hacker News new | ask | show | jobs
by LeoPanthera 733 days ago
Simply remove the .py from the filename. It's perfectly acceptable to call it "hello".

I can't think of a downside to the shebang. If you really wanted to run the script with a different interpreter, just specify it. "nohtyp hello" or whatever.

If that still bothers you too much, you could define an alias in your shell startup. For example, in bash, you might do:

alias hello="python3 /path/to/hello.py"

If you were so inspired, you could even write a short script to automatically create such aliases for the contents of a directory you specify.

1 comments

Node seems to be partial to whether one has a .mjs or not on the filename.