Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19469

Re: Where to put data

Date 2012-01-25 20:30 -0700
From Michael Torrie <torriem@gmail.com>
Subject Re: Where to put data
References <8184572.1820.1327512393386.JavaMail.geo-discussion-forums@prj1> <mailman.5084.1327517343.27778.python-list@python.org> <15493090.103.1327530570987.JavaMail.geo-discussion-forums@prhb20>
Newsgroups comp.lang.python
Message-ID <mailman.5110.1327548663.27778.python-list@python.org> (permalink)

Show all headers | View raw


On 01/25/2012 03:29 PM, bvdp wrote:
> Right now my program does a search for modules in "all the normal
> places", which seems to work for windows, mac and linux. Once the
> modules are found I just insert that location into sys.path[0].
> 
> Which permits the modules to reside anywhere on the HDD. However, I
> have feeling that this isn't quite pythonic

Unless you are writing a python library that will be used by others, I
don't think that where you put your files has anything to do with being
"pythonic" or not.  Just do what works for your OS.

On Linux, many packages written in many languages have to deal with the
problem of where to put their files.  For example, firefox, even when
installed as a package on Fedora, puts just about everything in
/usr/lib/firefox-#.#, and then symlinks the start binary back into
/usr/bin.  Other packages, such as Calibre, put things in
/usr/lib/calibre (most python modules go here), and some things like
extension scripts in /usr/share/calibre.  Other packages usr
/usr/libexec/packagename/.  In the case of both firefox and calibre, if
you install from tarball it makes a "firefox" or "calibre" folder in a
place of your choosing and dumps its stuff inside, sometimes with a
mini-unix directory structure (bin, share, lib etc).

On Mac of course, you can put everything in your application bundle.
That's how most standalone apps written in python work.

On Windows you could stick all your python modules in your application's
directory in Program Files.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Where to put data bvdp <bob@mellowood.ca> - 2012-01-25 09:26 -0800
  Re: Where to put data Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-25 10:33 -0800
    Re: Where to put data bvdp <bob@mellowood.ca> - 2012-01-25 14:27 -0800
  Re: Where to put data Evan Driscoll <edriscoll@wisc.edu> - 2012-01-25 12:48 -0600
    Re: Where to put data bvdp <bob@mellowood.ca> - 2012-01-25 14:29 -0800
      Re: Where to put data Michael Torrie <torriem@gmail.com> - 2012-01-25 20:30 -0700
        Re: Where to put data bvdp <bob@mellowood.ca> - 2012-01-26 08:30 -0800
          Re: Where to put data Michael Torrie <torriem@gmail.com> - 2012-01-26 20:20 -0700
            Re: Where to put data bvdp <bob@mellowood.ca> - 2012-01-27 19:11 -0800
            Re: Where to put data bvdp <bob@mellowood.ca> - 2012-01-27 19:11 -0800
        Re: Where to put data bvdp <bob@mellowood.ca> - 2012-01-26 08:30 -0800
    Re: Where to put data bvdp <bob@mellowood.ca> - 2012-01-25 14:29 -0800
  Re: Where to put data "Martin P. Hellwig" <martin.hellwig@gmail.com> - 2012-01-26 02:16 +0000
  Re: Where to put data John Nagle <nagle@animats.com> - 2012-01-27 14:15 -0800
    Re: Where to put data bvdp <bob@mellowood.ca> - 2012-01-27 19:13 -0800

csiph-web