I was using basic threading. This was the code I typed.
#!usr/bin/python3
import threading
class Bhai_ka_messenger(threading.Thread):
def run(self):
for message in range(10):
print threading.currentThread().getName()
a=Bhai_ka_messenger(name="message send")
b=Bhai_ka_messenger(name="message receive")
a.start()
b.start()
This says module object has no attribute thread. When I run this on an online IDE, this program works. Now I am not able to sort this problem,can anyone help?
You have called your local file threading.py
, but then import that file inside the file itself, causing it not to work.
I hope this can help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With