PyXMMS, a Python interface to XMMS

Florent Rougon
Tue, 11 Nov 2003 19:32:55 +0100


What is PyXMMS?

PyXMMS is a Python interface to XMMS, a multimedia player written for
the X Window System. PyXMMS can be used to control XMMS or manage its
main configuration file from a program written in Python.

What are the News?

I released PyXMMS 2, which contains a new component allowing to manage
the XMMS main configuration file. xmms is now a Python package, with
xmms.control providing the features found in PyXMMS 1.07 and xmms.config
providing the new features (however, I promise that code using the old
namespace won't break before at least 2005).


1) You can tell the XMMS session 2 to start playing with:

     import xmms.control

2) You can write the following call:

     import xmms.control as xc
                         ("file1.mp3", "file2.ogg", "http://u.r.l.ogg"),
                         "xmms", 0)

     - look if the XMMS session 0 is running and launch XMMS in
       the background if not (by the way, the two last arguments are
       optional and could be ommitted here);
     - add the three audio streams specified to the playlist;
     - tell the XMMS session 0 to start playing from file1.mp3.

3) You can play with the XMMS main configuration file:

     import xmms.config

     # Get the configuration from the default file
     # (usually ~/.xmms/config, but only libxmms really knows ;-)
     c = xmms.config.Config(fromfile="")
     # Extract the value associated to the "device" key in section "CDDA"
     print c["CDDA"]["device"]             # Prints e.g. '/dev/cdrom'
     # Alter this setting
     c["CDDA"]["device"] = "/dev/cdrecorder"
     # Write the new configuration to a file
     # Write it to the default file (don't do this at home, kids!)


PyXMMS is well documented. You can browse its documentation at:


or with pydoc during interactive sessions, for instance.


PyXMMS is licensed under the GNU GPL.


PyXMMS has been tested with Python 2.1, 2.2 and 2.3 (xmms.control might
work with earlier versions). The new component (XMMS configuration file
management) is only available for Python 2.2 and greater.

Home Page

You will find everything about PyXMMS on:


And PyXMMS-remote?

PyXMMS-remote is a companion program of PyXMMS. It exports the features
provided in xmms.control to your shell's command line (or a program...).
For instance, the same effect as in example 2 above can be achived with:

  pyxmms-remote E file1.mp3 file2.ogg http://u.r.l.ogg

PyXMMS-remote can be found alongside with PyXMMS, at:


Thanks for reading, and have fun.