如何使用ctypes python关闭窗口

问题描述 投票:0回答:1

我一直在尝试使用包含这样的包ctypes在python中创建一个程序:

import ctypes
import os

os.system("hello.mp3")

然后它打开Groove Music并播放音乐文件。

但我想要它做的是播放后关闭音乐文件。

我怎样才能做到这一点?

P.S如果没有使用ctypes包没关系

windows python-3.x windows-10 ctypes
1个回答
0
投票

试试mp3play模块。

https://pypi.org/project/mp3play/

它会是这样的

import mp3play as mP

file = 'C:\path\to\your\*.mp3'
song = mP.load(file)

song.play()
© www.soinside.com 2019 - 2024. All rights reserved.