摘要:
使用python实现AI机器人聊天工具其实还是蛮简单的,大致原理如下: 1、使用python的SpeechRecognition模块进行语音录音,代码如下: 1 import speech_recognition as sr 2 # Use SpeechRecognition to record 使 阅读全文
摘要:
1、队列代码示例 import threading import time from queue import Queue ''' Queue是线程安全的队列 ''' def set_data(q): index = 0 while True: q.put(index) index += 1 tim 阅读全文
摘要:
1、多线程使用案例 import time import threading def coding(): for x in range(0,3): print("正在写代码......") print(threading.current_thread()) time.sleep(1) def dra 阅读全文