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 [1] which explains how this is done. This requires using
Distribute/setuptools though, ...
[1]
http://packages.python.org/distribute/setuptools.html#automatic-script-creation
--
.''`. Wolodja Wentland <
[email protected]>
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQIcBAEBCAAGBQJLGkYEAAoJEIt/fTDK8U781q4P/3oK/RZ3ncDUmYVFRXFlF5tv
5heq94i7BLoo6U5Lw6P0E/+oMxC7TeWtmzvsF7eRY4j31MbO5SU4J+nnN+3bHplT
tbBb7yHdE6bxBBpOg2recVcJAhYDP4bj1/VKsNq4mScNZaOF+uh8ZmxkQaas+b13
NVhLnGGV8fu3cI77nYfrHgd10tuQdeR7/TAMLGyI3zH0+f9XLy9nuB/XnCvnWIEo
2tfnkO+1816L1URHjJ50E69BGp56ONRk4wvsIeXOtqIAY7Fv+xBtZQHvVp+NWZVX
7j6+0+XXIqf52NsVC+M5GOdx9nD5IefrX5kV3E/MnQgD6dxu52JH4RnuAxRB6OdL
/WgCNjikCR1kXA05u3TlcFFXIlTdhtqZaxahdLQzCxwe1cwsgZBVPY7TF/AdNvDS
MtmG4G5CE0SgNO6cBldug4i9Z5LPvwY+Q2RZteeGbXHThXZAwanBouvfUFH2kgkX
dIBcZrHbBb5DKQfQYoUSLa8gXpP5TphUMAf9Xvw2dLqUugjY5BGrLaf3sz0uNPW0
5e+EntO4HK+n17g5iJjquVA/3uyDp+AuLtCJKl5vaCpN2avBpl/kCwFGEtlxfvEo
sYIZQlEgzR5OPeSIIgay2lMjmRvoDPV6yBjU2DwETfyglPcNKoEpMkD7sVdVBl4p
mpTAuHdQNCruR3VBj8rJ
=27c+
-----END PGP SIGNATURE-----