Jump to content
Chapter7 Error Running Simple_Httpd.py
3 replies to this topic
Posted 20 May 2013 - 08:07 PM
HERE IS MY SERVER CODE:
from http.server import HTTPServer, CGIHTTPRequestHandler
port = 8080
httpd = HTTPServer(('', port), CGIHTTPRequestHandler)
print("Starting simple_httpd on port: " + str(httpd.server_port))
HERE IS MY ERROR MESSAGE:
from: can't read /var/mail/http.server
Error: Unrecognized action "port ="
/usr/local/webapp/simple_httpd.py: line 6: syntax error near unexpected token `('
/usr/local/webapp/simple_httpd.py: line 6: `httpd = HTTPServer(('', port), CGIHTTPRequestHandler)'
I would really appreciate some help.
Posted 20 May 2013 - 08:10 PM
Sorry. I have been going around in circles on this so long I missed an easy mistake. Let me make the first line read "python3 simple_httpd.py" and I'll get right back with the results. Thanks
Posted 20 May 2013 - 08:39 PM
THIS IS MY ERROR MESSAGE WITH THE AMENDED CALL TO THE simple_httpd.py:
Error code: 404
Message: No such CGI script ('/cgi-bin/generate_list.py').
Error code explanation: 404 - Nothing matches the given URI.
BUT, unlike the error for generate_timing_data.py in the book, I have a generate_list.py (functions well when run in isolation) in the cgi-bin folder in 'webapp' folder.
I need a break. But it would be nice to get this working before I take it.
Thank You All, I am very much enjoying learning from Head First Python.
Posted 30 May 2013 - 11:57 PM
Can you please post the code you are running (all of it) as well as a screenshot of the error message you are seeing.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users