CGI with Python

lynx a at b.c
Sat Sep 16 17:16:03 CEST 2000

u at, in <8psisk$178$1 at>:

> Hi experts, I am very new with python and linux. and i want to create a
> CGI script in binary format.


> 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.

More information about the Python-list mailing list