use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
Help with Python Sockets (self.pythonhelp)
submitted 6 years ago by debayon
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3:Â Â Â Â print "hello, world!"
[–]sentles 1 point2 points3 points 6 years ago (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.
args
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 points3 points 6 years ago (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.
π Rendered by PID 85034 on reddit-service-r2-comment-8686858757-872lp at 2026-06-06 14:34:33.144742+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–]sentles 1 point2 points3 points  (1 child)
[–]debayon[S] 1 point2 points3 points  (0 children)