Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alex@alex:~$ python
- Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
- [GCC 4.5.2] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> from threading import Thread
- >>> class SomeClass:
- ... def somemethod(self):
- ... print "hi"
- ...
- >>> someclass = SomeClass()
- >>> Thread(target=someclass.somemethod, args=[]).start()
- hi
- >>> Thread(target=SomeClass.somemethod, args=[someclass]).start()
- hi
Advertisement
Add Comment
Please, Sign In to add comment