thread question
maximilianscherr
MaximilianScherr at T-Online.de
Tue Feb 26 13:50:15 EST 2002
hmm if i now just have a random threadobject, like the one returned
from enumerate()
how can i then access the data(attributes, functions...) of that
thread?
--- In python-list at y..., "Jason Orendorff" <jason at j...> wrote:
> max wrote:
> > can i acces attributes, or functions of a thread(like if i
started
> > the class with threading.Thread(None, someclass)) like i can
access
> > classes? and if yes how? if no, how can i do it in another way?
>
> You probably want something like this.
>
> class SomeClass(threading.Thread):
> def run(self):
> ...
> ... Here you can access attributes and methods
> ... of self, which is a Thread object.
> ...
>
> myThread = SomeClass()
> myThread.start()
>
> ## Jason Orendorff http://www.jorendorff.com/
>
> --
> http://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list