CGI with Python

Max F. Rotem max at platonix.com
Tue Jan 9 10:03:34 EST 2001


First check the file permissions !!!
Second , in a source file at the first line add this >>

#!/usr/bin/python

or some other path where python can be found , so than compile it again

Best Regards,
Max F. Rotem

<paralizer at my-deja.com> wrote in message news:8q05q6$vnf$1 at nnrp1.deja.com...
> Thanks for your reply.
>
> Anyway, I still do not know how to run .pyc on the Apache... I read the
> file "error_log" in log directory. It said about "Apache don't know how to
> execute that file type"...I think I have to add file type (MIME) and
Handler
> as well... but I don't know python MIME type....
> as php3 is x-httpd-php3 ... and what is about python and its Handler?
>
> Looking forward to your reply.
>
> Thanks.
>
> In article <E6Lw5.4496$F9.131994 at news.corecomm.net>,
>   lynx <a at b.c> wrote:
> > u at book.co.th, in <8psisk$178$1 at nnrp1.deja.com>:
> >
> > > Hi experts, I am very new with python and linux. and i want to create
a
> > > CGI script in binary format.
> >
> > why?
> >
> > > first of all, i had a script that written
> > > in .py. and i compiled it with python command line... python -c
"import
> > > sourcefile" after that i got a file with .pyc extension in a binary
> > > format. is it able to run as CGI?
> >
> > not without the python executable. the "binary" file you have produced
is
> > not like the ordinary, executable-on-their-own binary files on your
> system,
> > see; it's not a standalone program.
> >
> > > anyway i heard that there is a tool called "Freeze". i have tried to
> > > freeze a .py code to make an executable file... you know?, it made a
> > > huge executable...
> >
> > yes, because it basically included the entire python bytecode
> interpreter -
> > that part of the ``python'' command that would have interpreted and run
> the
> > binary .pyc file you created. it's a large part of python, as you found
out.
> >
> > > any suggestion?
> >
> > install python on the webserver? either that, or (gaackk!) write your
> scripts
> > in C.
> >
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





More information about the Python-list mailing list