▲ | rhdunn a day ago | |
In a pyproject.toml file you can create/define scripts that reference an entry function. E.g.:
and in the pyproject.toml:
You can still use the __name__ check at the end of the file, e.g.:
That way it works both as a standalone and when installed via pip/uv. -- Note: The scripts created by the installer are slightly more complicated versions of that __name__ check that handle the application argument (arg 0) and the exit code as the return value from main(). |