I am writing a Python script to pre-process SVG files. I call a URL like:
http://example.com/includesvg.py?/myfile.svg
I would like the script "includesvg.py
" to return a 404
error if myfile.svg
does not exist. I have tried:
print "Status: 404 Not Found\r\n"
print "Content-Type: text/html\r\n\r\n"
print "<h1>404 File not found!</h1>"
It doesn't work.
This must be a duplicate question, but there are so many questions with "Python" and "404" that I can't find an existing answer.