Windows 如何使用ctypes python关闭窗口
我一直在尝试使用ctypes包在python中编写一个程序,该包的内容如下:Windows 如何使用ctypes python关闭窗口,windows,python-3.x,windows-10,ctypes,Windows,Python 3.x,Windows 10,Ctypes,我一直在尝试使用ctypes包在python中编写一个程序,该包的内容如下: import ctypes import os os.system("hello.mp3") 然后打开Groove音乐并播放音乐文件 但我希望它在播放后关闭音乐文件 我该怎么做 另外,如果不使用ctypes软件包也没关系试试mp3play模块 大概是 import mp3play as mP file = 'C:\path\to\your\*.mp3' song = mP.load(file) song.pl
import ctypes
import os
os.system("hello.mp3")
然后打开Groove音乐并播放音乐文件
但我希望它在播放后关闭音乐文件
我该怎么做
另外,如果不使用ctypes软件包也没关系试试mp3play模块 大概是
import mp3play as mP
file = 'C:\path\to\your\*.mp3'
song = mP.load(file)
song.play()
os.system
将运行您使用cmd.exe输入的命令如果您的电脑上有另一个应用程序,您可以通过cmd运行,该程序在文件播放结束后自动关闭,您可能只需使用os.system('application.exe'+filename)
感谢您的输入,但当我运行时,它会不断给我一个错误