Problem scenario
You want to write a program to call a bound function in a new thread. How do you do this?
Solution
Run this program (e.g., python foobar.py
):
from threading import Thread
class mighty:
def good():
print("Good")
def contint():
print("Hello!")
if __name__ == "__main__":
thread = Thread(mighty.good())
thread.start()
thread.join()
print("thread finished...exiting")