Re: how to organize a module that requires a data file

2005-11-17 Thread [EMAIL PROTECTED]
I have tried several ways, this is the way I like best (I develop in Windows, but this technique should work in *NIX for your application) :: \whereever\whereever\ (the directory your module is in, obviously somewhere where PYTHONPATH can

Re: how to organize a module that requires a data file

2005-11-17 Thread Steven Bethard
Larry Bates wrote: > Personally I would do this as a class and pass a path to where > the file is stored as an argument to instantiate it (maybe try > to help user if they don't pass it). Something like: > > class morph: > def __init__(self, pathtodictionary=None): > if pathtodictiona

Re: how to organize a module that requires a data file

2005-11-17 Thread Larry Bates
Personally I would do this as a class and pass a path to where the file is stored as an argument to instantiate it (maybe try to help user if they don't pass it). Something like: class morph: def __init__(self, pathtodictionary=None): if pathtodictionary is None: #

Re: how to organize a module that requires a data file

2005-11-17 Thread Steven Bethard
Terry Hancock wrote: > On Thu, 17 Nov 2005 12:18:51 -0700 > Steven Bethard <[EMAIL PROTECTED]> wrote: > >>My problem is with the text file. Where should I keep it? >> >>I can only think of a few obvious places where I could >>find the text file at import time -- in the same >>directory as the mo

Re: how to organize a module that requires a data file

2005-11-17 Thread Terry Hancock
On Thu, 17 Nov 2005 12:18:51 -0700 Steven Bethard <[EMAIL PROTECTED]> wrote: > My problem is with the text file. Where should I keep it? > > I can only think of a few obvious places where I could > find the text file at import time -- in the same > directory as the module (e.g. lib/site-package

Re: how to organize a module that requires a data file

2005-11-17 Thread Paul Boddie
Steven Bethard wrote: [Text file for a module's internal use.] > My problem is with the text file. Where should I keep it? If I want to > keep the module simple, I need to be able to identify the location of > the file at module import time. That way, I can read all the data into > the appropr