Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要做的是在 def (函数)运行时播放音频文件。我查了一下,发现线程可以工作,但是我的工作很复杂。大家有什么办法可以给我解释一下吗?我正在使用 winsound 播放音频文件和 SND_FILENAME。
尝试这个:
from multiprocessing import Process def play(): #winsound stuff def function(): #functiony stuff if __name__ == '__main__': p = Process(target=play) d = Process(target=function) p.start() d.start()