pyc file usage in a multi OS environment ( newbe question)

H

HajoEhlers

Hi folks,
i have an failover environment for a python application which can
fail-over to a AIX, Sun or Linux Box.
At the moment the python interpreter ( 2.4.2 on all platforms ) and the
application are installed localy but all data and configuration are on
a shared location ( NFS/GPFS)
So far no problem.
But the user are asking to get so called eggs installed which looks
like some python source code files and some metadata.
From the administration point of view it would be a mess to install and
maintain these - eggs - on all platforms.

So the question arise:
Can i install python code in a shared location so this code can be
loaded either from a AIX, Linux or a SunOS box ?

Since the .py file are plain python scripts i assume that these are
not causing any trouble but what about the .pyc file ? ( Which i could
not figure out what they are acutelly for - My knowledge about python
is more or less a drop of water within the python ocean )

tia
Hajo
 
F

Fredrik Lundh

HajoEhlers said:
Since the .py file are plain python scripts i assume that these are
not causing any trouble but what about the .pyc file ? ( Which i could
not figure out what they are acutelly for - My knowledge about python
is more or less a drop of water within the python ocean )

PYC files contain cached compiled Python byte code. there's also PYO
files, which are optimized PYC files (created by running Python with the
-O flag).

PYC and PYO files are compatible across platforms, but not across major
Python releases (e.g. 2.4.X cannot use 2.3.X byte codes).

note that PYC files are created automatically when PY files are imported
(if there's no newer PYC file already available), and the creation process
is not NFS-safe in itself, so you may end up with assorted race problems
if you're not careful...

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top