Exception in thread thread-2 , TypeError: clickc() argument after * must be an iterable, not bool
Exception in thread thread-2 , TypeError: clickc() argument after * must be an iterable, not bool
我正在尝试制作一个用键盘控制的自动答题器。我得到
Exception in thread thread-2
确实我明白了
TypeError: clickc() argument after * must be an iterable, not bool
import keyboard, pyautogui as pag
import time
import threading
number = 9999999999999999999999999999999999999999999999999999999999999999999999999999999
fk = False
def clickc(fk):
if fk == True:
pag.click(button="left", clicks=5, interval=1)
else:
return None
def keycontrol(x, shutdown):
try:
if keyboard.is_pressed(x):
return True
if keyboard.is_pressed(shutdown):
return False
except:
pass
p1 = threading.Thread(target=keycontrol, args=("f","v"))
p0 = threading.Thread(target=clickc, args=fk)
fk = p1.start()
p0.start()
这是完整的错误:
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Users\muham\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\muham\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
TypeError: clickc() argument after * must be an iterable, not bool
[Finished in 0.4s]
您的 'p0' 参数应该是一个可迭代的(元组、列表等),如 'p1':
p0 = threading.Thread(target=clickc, args=(fk,))
我正在尝试制作一个用键盘控制的自动答题器。我得到
Exception in thread thread-2
确实我明白了
TypeError: clickc() argument after * must be an iterable, not bool
import keyboard, pyautogui as pag
import time
import threading
number = 9999999999999999999999999999999999999999999999999999999999999999999999999999999
fk = False
def clickc(fk):
if fk == True:
pag.click(button="left", clicks=5, interval=1)
else:
return None
def keycontrol(x, shutdown):
try:
if keyboard.is_pressed(x):
return True
if keyboard.is_pressed(shutdown):
return False
except:
pass
p1 = threading.Thread(target=keycontrol, args=("f","v"))
p0 = threading.Thread(target=clickc, args=fk)
fk = p1.start()
p0.start()
这是完整的错误:
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Users\muham\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\muham\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
TypeError: clickc() argument after * must be an iterable, not bool
[Finished in 0.4s]
您的 'p0' 参数应该是一个可迭代的(元组、列表等),如 'p1':
p0 = threading.Thread(target=clickc, args=(fk,))