Controlling Windows Media Player from Python

Avizoa at gmail.com Avizoa at gmail.com
Mon Jul 3 11:47:44 EDT 2006


Jeffrey Barish wrote:
> Is there a way to interact with Windows Media Player from Python?  I would
> like to be able to do things like tell WMP to play a given sound file or to
> ask WMP for metadata about a sound file.
> --
> Jeffrey Barish



The fact of the matter is that python doesn't need to ask WMP for the
metadata. Python can get the metadata from the file itself and then
tell the computer to play the file.

If you're looking to do something more complicated, try PyMedia or even
download wxPython and take a look at the examples. There's an embedded
WMP example.



By the way, someone has most likely made a module specifically for
reading the metadata from many types of music files, but I don't have
time to look. Maybe someone else can point you in the right direction.
For telling WMP to play the file you want one of the os.exec variants.




More information about the Python-list mailing list