> web2py provides a file cgihandler.py to interface to CGI. If still in doubt, use google:
http://web2py.com/AlterEgo/default/show/93 (As far as I understand, a cgi program expects input via stdin, and sends output to stdout, but I'm by no means an expert) Best regards, Stefaan.