[distutils] Install script under a different name
wentland at cl.uni-heidelberg.de
Sat Dec 5 12:37:40 CET 2009
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, ...
.''`. Wolodja Wentland <wentland at cl.uni-heidelberg.de>
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the Python-list