0
Multithreading in python
Please check the code and help to remove bug and run this. from threading import * class hello(): def run(self): for i in range(200): print("Hello") class hii(): def run(self): for i in range(200): print("Hii") h1=hello() h2=hii() h1.start() h2.start()
4 ответов
+ 3
a=Thread(target=h1.run)
b=Thread(target=h2.run)
a.start()
b.start()
+ 2
You need to make your custom classes inherit from the Thread class like this :
class hello(Thread):
Then the code will run.
+ 2
you are not using threading, you just imported it.
and your classes have run() methods not start()
0
I have tried that too putting thread in class but the error is “”not able to call list like this