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


Groups > comp.lang.python > #19498

Re: Where to put data

From "Martin P. Hellwig" <martin.hellwig@gmail.com>
Newsgroups comp.lang.python
Subject Re: Where to put data
Date 2012-01-26 02:16 +0000
Organization A noiseless patient Spider
Message-ID <jfqd23$1eq$1@dont-email.me> (permalink)
References <8184572.1820.1327512393386.JavaMail.geo-discussion-forums@prj1>

Show all headers | View raw


On 25/01/2012 17:26, bvdp wrote:

<cut explanation of bikeshed argument, where do I put the darn things>

Well once you think about distributing, here is the guide line I use:

- If it is meant as a library that can be 'imported' in python:
 > site-packages is the place to be, some linux distros are rather 
creative with them so be careful.

- If it is a 'stand-alone' application that just happens to use the 
python interpreter as a dependency:
 > /usr/local/bin for the executable script and /usr/local/lib for the 
program module(s) itself, of course this is platform dependent, consult 
posix first and then distribution/os specific preferences.

- If the additional (binary) data is static in nature:
 > /usr/local/share is the right place (or whichever preference the 
distribution/os has)

- If the additional (binary) data is dynamic in nature (like databases) 
and the program is run as a daemon:
 > /usr/local/,  /var/ or /opt/

- If the additional (binary) data is dynamic and it is run per user:
 > $HOME/.[application name]/ (the famous dot files in your home folder).

All that is unix like of course, Windows tend to put it all in the 
application folder in the Program Files folder, and user specific data 
in the profiles Application Data.

Of course opinions vary so I can only say this is what I usually follow, 
with the wisdom bestowed upon me by unix admins that where much more 
experience then I ever will be and always had a fit when I didn't put it 
in the right directory.

YMMV
-- 
mph

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