From wdhawes at gmail.com Tue Aug 4 14:00:05 2009 From: wdhawes at gmail.com (Will Hawes) Date: Tue, 4 Aug 2009 13:00:05 +0100 Subject: [PythonCE] PythonCE, Apache and CGI? Message-ID: <360eac500908040500y7511ce5crdc7ed6e0a18974dd@mail.gmail.com> I've got perl CGI scripts running on Apache on a Windows Mobile 6 device using http://www.rainer-keuchel.de/wince/apache-ce.html and http://perlce.sourceforge.net/. I'm trying to get Python working in the same way, which seems as though it might be possible, but have hit a problem. With the device connected via ActiveSync, I tried accessing the following python script via "http://169.254.2.1/cgi-bin/test.py": #!/python25/python.exe print "Content-type: text/html\n\n" This resulted in the PythonCE shell popping up on the device, where it appeared to generate the correct output, but the output was not sent to the browser. I read about the "/nopcceshell" switch on the PythonCE wiki so tried this instead: #!/python25/python.exe /nopcceshell print "Content-type: text/html\n\n" The web browser still hangs, but the PythonCE shell no longer appears on the device. Instead I see the following error on the device: Traceback (innermost last): File "\apache\cgi-bin\test.py", line 3, in print "Content-type: text/html\n\n" : [Errno 2] The system cannot find the file specified Evidently Python is finding and trying to execute test.py - my guess is that this error relates to either STDOUT or STDERR. Can anyone shed any light on this, or better still provide a workaround? Thanks, Will