pyc runtime error

Chris Rebert clp2 at rebertia.com
Wed Jun 30 04:14:55 EDT 2010


On Wed, Jun 30, 2010 at 1:06 AM, Baris CUHADAR <189780 at gmail.com> wrote:
> Can anyone explain this unexpected behavior?
> all files chmod 755, i've compiled x.py with py_compilefiles,
> also tried within python console with "import x"
>
> system:  centos 5.4 32bit
>
> This a PATH related problem i think?

Nope.

> [root at centos-14 cgi-bin]# ./x.pyc

.pyc files are just bytecode, not scripts, so you can't run them as
scripts/executables under *nix. Run the .py file instead. Or do
`python x.pyc` like you showed.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list