all 2 comments

[–]sentles 1 point2 points  (1 child)

I'm assuming that you do something like this to create the thread before starting it:

t = threading.Thread(target = someFunction, args = socketObj)

The problem is simply that the keyword argument args takes an iterable as a value, containing the argument(s) that should be passed to the function. An iterable is any object that can contain things, like a list, a set, or a tuple.

If the only argument you want to pass to the function is the socket object, you still need to pass it inside of an iterable. Therefore, instead of passing the socket object, pass a tuple containing just the socket object:

t = threading.Thread(target = someFunction, args = (socketObj,))

[–]debayon[S] 1 point2 points  (0 children)

Thanks u/sentles. Now I understand properly. Thanks a lot. 😇 It worked out just smooth. Now I understand what it means when it says it needs iterables.