СИ
pyperclip.copy(str(text)) увидел text когда for text in listen(): шел не в функции то все работало
def cou():
global counter
counter = 2
time.sleep(0.05)
cou1()
keyboard.add_hotkey('ctrl', lambda: cou())
def listen():
while True:
data = stream.read(4000, exception_on_overflow=False)
if (rec.AcceptWaveform(data)) and (len(data) > 0):
answer = json.loads(rec.Result())
print(str('ок'))
if answer["text"]:
yield answer["text"]
if counter == 2:
pyperclip.copy(str(text)) вот тут не видит text
keyboard.send('ctrl+v')
if answer["text"]:
yield answer["text"]
def list():
for text in listen():
if text == 'тестирую переменную':
sea()
processThread = Thread(target=list, )
processThread.start()
