Re: cgi "print statement" in multithreaded enviroment?

2005-05-03 Thread Scott David Daniels
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

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread vegetax
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, >>

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread vegetax
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

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread Bengt Richter
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

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread vegetax
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

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread Jeff Epler
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,

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread Paul Rubin
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

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread vegetax
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

Re: cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread Irmen de Jong
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

cgi "print statement" in multithreaded enviroment?

2005-05-02 Thread vegetax
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