CGI and images

Michael Ströder michael at stroeder.com
Sun Jul 2 10:42:07 EDT 2000


Yannick Le Teigner wrote:
> 
> print "Content-type: image/gif\n\n"
                                ^^^^
Only one \n is needed if using print.

> print open(myImage, "rb").read()

Again: print adds an extra \n to the output. Use sys.stdout.write()
instead to have full control. If mixing print and sys.stdout.write()
you might have to use sys.stdout.flush() sometimes.

Ciao, Michael.



More information about the Python-list mailing list