Question

I've amassed a small collection of small handy ad hoc scripts that I would like to have available to me in all my python projects and ipython interactive sessions. I would like to add to and clean up this collection without having to worry about making setup.py files and installing them formally. From the list of directories on the sys.path by default, what's the proper home for these scripts?

Était-ce utile?

La solution

The user site directory should be the right directory for such things.

python -m site --user-site

shows you the correct path for your platform. Usually its something like
$HOME/.local/lib/python<version>/site-packages

You can even put a module sitecustomize.py there which will be imported automatically on each interperter startup.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top