First when using "print" to output information to browser, the first line must be "Content-type: text/html". the value of type could be other file formats that browser can parse.
The second thins should be noted is that: the first line of python should be “#! python_path/python.exe -u" to print out to web-server.
or
Add "ScriptInterpreterSource Registry" to the bottom of Apache/conf/httpd.conf
and maybe you should to add:
SetEnv PYTHONUNBUFFERED 1
PassEnv PYTHONPATH