我想在运行Windows 7的Python 3中编写程序。我希望程序能够在窗口中显示文本并同时播放音频文件。我可以在不同的时间顺利完成这两个流程。我如何在同一时间完成这些流程?下面是从程序取的代码块:如何在Python中一次运行2个不同的进程
import lipgui, winsound, threading
menu = lipgui.enterbox("Enter a string:")
if menu == "what's up, lip?":
t1 = threading.Thread(target=winsound.PlaySound("C:/Interactive Program/LIP Source Files/skyisup.wav", 2), args=(None))
t2 = threading.Thread(target=lipgui.msgbox("The sky is up"), args = (None))
能否请您提前从已给出,其中表现出更多的代码。你现在的代码发生了什么?它应该工作,并使两者同时运行。 –
编辑它。这是完整的脚本。它仍然在不同的时间做它们! –