Answer the question
In order to leave comments, you need to log in
How to solve missing argument 'self' error of pythreading module when calling a function from a class?
The bottom line is. There is a class, it describes how to work with VK.
One of its functions is a while loop that waits for data to arrive.
The main function code contains
look_for_msgs = threading.Thread(target=Vkontakte__.import_messages) #, args=(b.get('text'),user__id)
Answer the question
In order to leave comments, you need to log in
I found an acceptable solution. Instead of a class, I wrote its wrapper inside another file.
Well, for example. It was:
class test:
def init(self):
self.x = 5
def print_(self):
print(self.x)
w = 1
def init():
print(w)
import test
import threading
w = 2
there_is_no_spoon = threading.Thread(target=test.init)
there_is_no_spoon .start()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question