本帖最后由 keshun 于 2021-11-5 10:47 编辑
- import win32com.client, pythoncom, threading, time
-
- def aa():
- pythoncom.CoInitialize()
- speak = win32com.client.Dispatch('SAPI.SPVOICE')
- speak.Speak(a)
-
- a='1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20'
-
- for i in range(10):
- threading.Thread(target=aa).start()
- for j in range(5):
- time.sleep(1)
- print('{}{}'.format(i,j))
-
- input("关闭窗口")
复制代码 报读慢造成子线程堵塞报错,请教高手? |