I have a class MyThread. In that, I have a method sample. I am trying to run it from within the same object context. Please have a look at the code:
class myThread (threading.Thread):
def __init__(self, threadID, name, counter,
self.threadID = threadID
self.name = name
self.counter = counter
self.redisOpsObj = redisOpsObj
self.kill_received = True
print "\n Starting " + self.name
Looks very simple ain't it. But when I run it I get this error
AttributeError: 'myThread' object has no attribute 'sample'
Now I have that method, right there. So what's wrong? Please help
If you want to unleash your potential in this competitive field, please visit the Python course page for more information, where you can find the Python tutorials and Python frequently asked interview questions and answers as well.
This topic has been locked/unapproved. No replies allowed