'import CGI' brings up ghost from past - Raspberry Pi Forums


hi, folks!

think it's bug in python module.

here's server:

code: select all

#!/usr/bin/python3.4 #!/usr/bin/env /usr/bin/python3.4  http.server import httpserver \     srv, cgihttprequesthandler cgi import os  os.chdir("/home/pi/")  srv = srv(('', 8000), cgi) srv.serve_forever() 
here's request handler (called cgi-bin/formula.py):

code: select all

#!/usr/bin/python3.4 #!/usr/bin/env python3.4  import cgi  print("""\ http/1.1 200 ok content-type: text/html  <!doctype html> <html>   <body>     <p>hello, world!</p>   </body> </html> """) 
as-is send website browser working on long time ago. puts out "hello, world!" asked time.

can fix taking out "import cgi", of course need parsing cgi parameters. no stretch out names in server source. can me diagnose this? amazingly, if put "import cgi" in, finds same old website!

i'm studying, i'm afraid still on head.... in advance.

i see folks in perl world having trouble module:http://www.perlmonks.org/bare/?node_id=744270 site has link in comments section simpler.


raspberrypi



Comments