Mike Looijmans yazmış:
Your code is perfectly thread safe, yes. But the assignment to
sys.stdout IS NOT. There is only one sys.stdout, and all threads use
the same one.
Example (two threads):
##Thread 1:
- initializes request from client 1
- sets sys.stdout to StdOut(request ...) object
- wr
Your code is perfectly thread safe, yes. But the assignment to
sys.stdout IS NOT. There is only one sys.stdout, and all threads use the
same one.
Example (two threads):
##Thread 1:
- initializes request from client 1
- sets sys.stdout to StdOut(request ...) object
- writes "hello1 " to sys.std
Mike Looijmans yazmış:
Fırat KÜÇÜK wrote:
Hi,
we have been started a project called wepy! it is a modpython based
PHP and
Python mix. Here are the some samples about wepy:
It would help a lot if you'd share with us exactly what you are trying
to accomplish here. Your examples look a lot
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 pr
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
proces