John Joseph wrote:
> Hi
> I am trying to execute .py scripts from my
> apache web server , but it is not giving the results
> as how I run php files , it just displays the
> contents of the script , I am able to run and get
> results of PHP from the same loaction
> my “sample-test.py “file is as follows
>
For python scripts to run in my Apache2Triad installation the script
must start with #!h:/apache2triad/python/bin/python.exe
I suggest you add a similar comment (with your path to python.exe). When
I remove that line I get Server Error 500. So I think there is more
involved. In my Apache httpd.conf (configuration file) is the following:
#python config
LoadFile python\bin\python23.dll
#LoadModule python_module modules/mod_python.so
Alias /python/ "h:/apache2triad/python/"
AddHandler python-program .spy
PythonHandler run_spyceModpy::spyceMain
AddHandler mod_python .psp
PythonHandler mod_python.psp
PythonDebug On
Do you have anything like that in yours?
> import cgi
> reshtml = '''Content-Type: text/html\n
> Friends CGI Demo (dynamic screen)
>
> Friends list for: Joseph
> Your name is: John
> You have 20 friends.
> '''
> When I access this script from the url
> “http://192.168.20.99/~john/ sample-test.py”
> in the browser I see the contents of the file , not
> the result
>
> Is there any function similar to phpino() in python ,
> so that I can test
>Guidance requested ,
>Joseph John
>
>
>
>
> ___
> To help you stay safe and secure online, we've developed the all new Yahoo!
> Security Centre. http://uk.security.yahoo.com
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
>
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor