pyc runtime error

Baris CUHADAR 189780 at gmail.com
Wed Jun 30 04:06:27 EDT 2010


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?


[root at centos-14 cgi-bin]# ./x.pyc
: command not found
./x.pyc: line 2: syntax error near unexpected token `)'
./x.pyc: line 2: `��)Lc@sdGHdGHdkZeiGHdS(sContent-Type:text/
html'


[root at centos-14 cgi-bin]# python x.pyc
Content-Type:text/html


python
2.4.3 (#1, Sep  3 2009, 15:37:12)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]

--------------------------------------------------------------------------------------------

x.py file content:

#!/usr/bin/env python

print "Content-Type:text/html\n\n"
print "python"
import sys
print sys.version

--------------------------------------------------------------------------------------------





More information about the Python-list mailing list