[docs] Setting a python cgi-bin web service

Renato Battistin rbattistin at apf.it
Sun Jan 11 12:06:49 CET 2015


Hello,

I don't known if it is a bug, but the following script example at 
https://docs.python.org/3.3/howto/webservers.html created me some 
problems during the setting of an apache2 cgi-bin python script service:


--------------------
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

# enable debugging
import cgitb
cgitb.enable()

print("Content-Type: text/plain;charset=utf-8")
print()

print("Hello World!")
----------------

I solved the problem changing the above script to:

--------------------
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

# enable debugging
import cgitb
cgitb.enable()

print "Content-Type: text/plain;charset=utf-8"
print

print "Hello World!"
----------------

I used Python 2.7

Regards

Renato Battistin
FERMO POSTA
I-31041 CORNUDA TV
ITALY


More information about the docs mailing list