I am using the keyboard library to create a button that starts and stops with the press of a button and I keep getting errors this is the code
while True:
if keyboard.on_press('esc') == True:
if start == 0:
start = 1
else:
start = 0
while start == 1:
print('yes')
sleep(1)
and this is the error im getting while pressing the 'p' key
yes
yes
Traceback (most recent call last):
File "C:\Users\olawa\PycharmProjects\dj4e\venv\lib\site-packages\keyboard\_generic.py", line 22, in invoke_handlers
if handler(event):
File "C:\Users\olawa\PycharmProjects\dj4e\venv\lib\site-packages\keyboard\__init__.py", line 474, in <lambda>
return hook(lambda e: e.event_type == KEY_UP or callback(e), suppress=suppress)
TypeError: 'str' object is not callable