distutils for apps?

Neal Norwitz neal at metaslash.com
Sun Nov 11 22:14:35 EST 2001


Andrei Kulakov wrote:
> 
> Hello pygang, I just read distutils docs and I can't figure out how to
> tell it to install one file into path. I have a bunch of .py files, one
> of them is meant to be executed by the user, and the rest are modules.
> Do I copy it to /usr/local/bin myself? It just seemed logical that
> distutils would do that.

	distutils.core.setup(name='name',
				#...
				packages=[ 'pkg1', 'pkg2', 'pkg3', ],
				scripts=[ 'script1', 'script2', ],
				#...
				)

pkg1, pkg2, pkg3 will be copied into the python site-packages directory.
For example, /usr/local/lib/python2.1/site-packages/pkg?.
pkg? are directories which contain .py files.

script1 and script2 will be copied into the local script directory
(usually /usr/local/bin).  These can be shell scripts.

Here's one that I use:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/pychecker/pychecker/setup.py?rev=1.29&content-type=text/plain

Neal



More information about the Python-list mailing list