Python可以打开mp3文件吗 [英] Can Python open a mp3 file

查看:319
本文介绍了Python可以打开mp3文件吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Python中打开 mp3 文件(可以使用Popen),我并不是要在程序中运行它,而是要在媒体播放器或其他程序中作为单独的窗口运行只是为了在我调用该函数时将其打开,如果可以的话怎么打开?

Is it possible to open an mp3 file in Python (possible using Popen) and I don't mean to run it in the program I mean as a separate window in media player or whatever just for it to open it when I call the function and if so how?

推荐答案

使用关联的应用程序打开文件(仅适用于 Windows ):

Opening a file with its associated application (Windows only):

import os
os.startfile('my_mp3.mp3')

可以在此处找到文档的链接..

这篇关于Python可以打开mp3文件吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆