Hacker News new | ask | show | jobs
by Fabricio20 14 days ago
Shebang! Notice the first line of the script: #!/usr/bin/env python3 marks the file to be executed by python. I think it's like a shell? linux? thing so that tooling can just execute the file without having to find the python interpreter (ie: _execute_ the file vs running python against the file).

Dont quote me on the specifics though, and honestly why it can't _just_ be a python file I couldn't tell you, claude code can very much run a python <filename> but maybe thats what the author tried to avoid (or the llm).

1 comments

It’s a POSIX thing, and it has nothing to do with the file extension. The OP is right: file extensions are optional (and, as shown here, often actively misleading), but if they’re present they should match the actual file type. Which, in this case, is Python code , not a shell script.