[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: where do my python files go in linux?

Mike Meyer

1/12/2008 8:26:00 PM

On Sat, 12 Jan 2008 16:13:08 +0100 "Jorgen Bodde" <jorgen.maillist@gmail.com> wrote:
> > Normally you'd split up the bulk of the code into a module which gets
> > installed into site-packages and a piece of stand-alone front-end code which
> > imports the module and executes whatever you need to do and gets installed
> > into a typical PATH directory.
> I would agree but it is not a site package I am trying to distribute,
> but a wxPython application. I would not think my app belongs in the
> python site packages dir.

I suspect that's because your app is "simple", in that it only has one
command. Many apps have multiple commands that share the same set of
libraries. So putting a package for that app in site-packages makes a
lot of sense. If your app-specific library is properly designed and
documented, users may be able to build further commands for the system
as well.

On the issue of .pyc files - don't distribute them. Instead, arrange
for the install package to run the compileall.py script (in the
standard library) on your libraries. .pyc files are *not* guaranteed
to be platform independent (even though the latest rpm tools seem to
claim otherwise), so if you build them for your platform, they may
well be unusable after being installed.

<mike
--
Mike Meyer <mwm@mired.org> http://www.mired.org/consu...
Independent Network/Unix/Perforce consultant, email for more information.
1 Answer

Carl Banks

1/12/2008 9:10:00 PM

0

On Sat, 12 Jan 2008 15:25:53 -0500, Mike Meyer wrote:

> On Sat, 12 Jan 2008 16:13:08 +0100 "Jorgen Bodde"
> <jorgen.maillist@gmail.com> wrote:
>> > Normally you'd split up the bulk of the code into a module which gets
>> > installed into site-packages and a piece of stand-alone front-end
>> > code which imports the module and executes whatever you need to do
>> > and gets installed into a typical PATH directory.
>> I would agree but it is not a site package I am trying to distribute,
>> but a wxPython application. I would not think my app belongs in the
>> python site packages dir.
>
> I suspect that's because your app is "simple", in that it only has one
> command. Many apps have multiple commands that share the same set of
> libraries. So putting a package for that app in site-packages makes a
> lot of sense.

They should go into their own directory in /usr/local/lib (or whatever).


> If your app-specific library is properly designed and
> documented, users may be able to build further commands for the system
> as well.

Users can still add the /usr/local/lib/whatever to their path path and
use it that way.

I realize it's a fine line and a judgment call in some cases, but site-
packages is really for libraries; applications should use their own
directories.


Carl Banks