import sys
sys.stdout.write(open('penguin.png', 'rb').read())
NO. NO. NO.
sys.stdout is a global variable. If you want sys.stdout.write() to end
up in the user's terminal, your web server will be able to either
serve only one request at a time, or must be forced into running
separate processes for each concurrent request (which will not happen
on windows and many other supported platforms).
We made that mistake with cgipython, and we won't make it again. Learn
from the mistakes of others, as you do not have the time to make them
all yourself.
Mike
Hi,
but i replaced sys.stdout with a StdOut class. is it problem too?
Fırat KÜÇÜK