[distutils] Install script under a different name

Nikolaus Rath Nikolaus at rath.org
Sat Dec 5 11:12:14 EST 2009


Wolodja Wentland <wentland at cl.uni-heidelberg.de> writes:
> 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?
>
> You can also use entry points to create the executable at install time.
> Have a look at [1] which explains how this is done. This requires using
> Distribute/setuptools though, ...
>
> [1] http://packages.python.org/distribute/setuptools.html#automatic-script-creation

That looks perfect, thanks!


Best,

   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C



More information about the Python-list mailing list