|| at Dec 5, 2009 at 11:37 am
On Fri, Dec 04, 2009 at 19:34 -0500, Nikolaus Rath wrote:
All my Python files have extension .py. However, I would like to install
scripts that are meant to be called by the user without the suffix, i.e.
the file scripts/doit.py should end up as /usr/bin/doit.
Apparently the scripts= option of the setup() function does not support
this directly. Is there a clever way to get what I want?
Just name the file you want to install 'doit' and not 'doit.py'. That
would be the easiest way. You might run into problems on Windows though,
which IIRC (it's been a while) heavily relies on file suffixes and not
on their content. That might have changed in the last 10 years though,
so better check that first.
You can also use entry points to create the executable at install time.
Have a look at  which explains how this is done. This requires using
Distribute/setuptools though, ...