logoalt Hacker News

kstrauserlast Tuesday at 11:37 PM0 repliesview on HN

Gotcha.

I do understand your point, but that's pretty common for Python. Say you're using poetry (https://python-poetry.org/docs/pyproject/#scripts) or Uv (https://docs.astral.sh/uv/concepts/projects/config/#command-...) or setuptools (https://setuptools.pypa.io/en/latest/userguide/entry_point.h...) to define "scripts" for your package. Those tools will autogenerate a file like the one you posted here that basically import the package and then call a specific function inside it.

Almost all interesting Python scripts import another module, so it's really unusual to see all of a program's code in one file anyway. These autogenerated scripts just take it a step further.