Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Python open a mp3 file using a separate media player? [closed]

Tags:

python

popen

mp3

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?

like image 850
DonJuma Avatar asked Jul 07 '10 20:07

DonJuma


1 Answers

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

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

A link to the documentation can be found here.

like image 145
ChristopheD Avatar answered Oct 17 '22 07:10

ChristopheD