For my applications installed with distutils, I look at the sys.argv argument for the path in which my main python file resides. Then I append a relative path to sys.path before I attempt to import my application modules.
This seems like a very reasonable way to do it. I install the whole directory tree for my app in /usr/local/appname or /usr/local/share/appname and put a launch script in /usr/local/bin
On Mon, Jul 23, 2001 at 11:40:44AM +0200, Gernot Jander wrote:
Is there any known "standard" directory location for complete applications written in Python?
I think a typical internationalized application contains at least four different file types:
- an executable (Python-)script
- one or more (Python-)modules (specific for this application)
- one or more subdirectories containing xxx.mo files for gettext
- a xxx.rc file for gtk-styles
Splitting this up in /usr/local/bin, /usr/python/site-packages and /usr/local/share makes it hard to de-install the application. Furthermore I think that application-specific modules should not go to site-packages, since this is the place for global packages/modules and not for modules that are only meaningfull in the context of one application.
Therefore I decided to have one /usr/local/python/xxx directory for each of my applications and install all files there (besides the scripts). But this solution implies to have these directories in the $PYTHONPATH and makes the distribution not portable to other OS.
Are there any intentions to improve the support of applications in distutils?
Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig