vegetax wrote:
> So it would be something like this, right??
>
> class ThreadSpecificFile:
> def __init__(s):
> self.files = []
> def set_stdout(f,thread_id):
> self.files[thread_id] = f
> def clean_up(thread_id):
> del self.files[t
Bengt Richter wrote:
> On Mon, 02 May 2005 20:24:02 -0400, vegetax <[EMAIL PROTECTED]> wrote:
>
>>Irmen de Jong wrote:
>>
>>> vegetax wrote:
How can i use cgi'like print statement in a multitreaded web framework?
each thread has its own Servlet instance with request/response objects,
>>
vegetax wrote:
> Jeff Epler wrote:
>
>> You could write something like
>> class ThreadSpecificFile:
>> def set_stdout(f):
>> self.files[thread_id] = f
>> def write(data):
>> self.files[thread_id].write(data)
>> sys.stdout = ThreadSpecificFile()
>> w
On Mon, 02 May 2005 20:24:02 -0400, vegetax <[EMAIL PROTECTED]> wrote:
>Irmen de Jong wrote:
>
>> vegetax wrote:
>>> How can i use cgi'like print statement in a multitreaded web framework?
>>> each thread has its own Servlet instance with request/response objects,
>>> sys.stdout = self.response(wh
Jeff Epler wrote:
> You could write something like
> class ThreadSpecificFile:
> def set_stdout(f):
> self.files[thread_id] = f
> def write(data):
> self.files[thread_id].write(data)
> sys.stdout = ThreadSpecificFile()
> where you'll have to fill out
You could write something like
class ThreadSpecificFile:
def set_stdout(f):
self.files[thread_id] = f
def write(data):
self.files[thread_id].write(data)
sys.stdout = ThreadSpecificFile()
where you'll have to fill out a few more things like thread_id,
vegetax <[EMAIL PROTECTED]> writes:
> But i want to use "print" as a commodity feature, print >>
> self.response,'html..' is longer to type than
> self.response.write('html..')
w = self.response.write
w('html...')
w('more html...')
w('still more html')
--
http://mail.python.org/mailman/listinfo
Irmen de Jong wrote:
> vegetax wrote:
>> How can i use cgi'like print statement in a multitreaded web framework?
>> each thread has its own Servlet instance with request/response objects,
>> sys.stdout = self.response(which is a file like object) wont work because
>> all threads will set the same
vegetax wrote:
> How can i use cgi'like print statement in a multitreaded web framework?
> each thread has its own Servlet instance with request/response objects,
> sys.stdout = self.response(which is a file like object) wont work because
> all threads will set the same file object and it will be a
How can i use cgi'like print statement in a multitreaded web framework?
each thread has its own Servlet instance with request/response objects,
sys.stdout = self.response(which is a file like object) wont work because
all threads will set the same file object and it will be a concurrence
mess.
I
10 matches
Mail list logo