TypeError in Threading. function takes x positional argument but y were given [duplicate]

The args kwarg of threading.Thread expects an iterable, and each element in that iterable is being passed to the target function.

Since you are providing a string for args:
t = threading.Thread(target=startSuggestworker, args=(start_keyword))

each character is being passed as a separate argument to startSuggestworker.

Instead, you should provide args a tuple:

t = threading.Thread(target=startSuggestworker, args=(start_keyword,))
#                                                                  ^ note the comma

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)