CGI -- generating images -- \x0A always added!
NO-MAIL at hotmail.com
Wed Sep 10 05:05:51 CEST 2003
I'm trying to use Python for generating (or copying) images.
The environment is Python 2.3/Apache 2.0.43/Windows XP.
I couldn't make Apache use mod_python (anybody can help?
Apache complains "The requested operation has failed"
if I add LoadModule python_module modules/mod_python.so)
so I use the CGI mechanism. This is the sample:
img = open( 'a.gif', 'rb' ) # OK, don't make the image, just use the file
data = img.read()
print "Content-type: image/gif"
Everything's good, and '-u' helps not to add '\x0D' for each '\x0A'
inside the data. BUT it seems that the last print ALWAYS adds LF
'\x0A' in spite of the final comma. How can I fix that? Thank you.
More information about the Python-list