python on unix [getting started]

Paul Boddie paul at boddie.net
Mon Nov 18 05:29:23 EST 2002


"dsavitsk" <dsavitsk at e-coli.net> wrote in message news:<POQB9.636$Kw6.474127 at newssrv26.news.prodigy.com>...
> "Martin v. Loewis" <martin at v.loewis.de> wrote in message
> news:m34ragk3ts.fsf at mira.informatik.hu-berlin.de...
> 
> Thanks for the response
> 
> > > In particular, I would like to control mpg123 (i think?).
> >
> > Depends on what precisely "this" is. In general, on Unix, there is
> > nothing like COM. So when you want to use some functionality written
> > by somebody else, you have two options:

This depends a lot on the environment you have available. Both KDE and
GNOME provide their own object model, and it's certainly possible to
control applications using DCOP in KDE, provided that such
applications expose some kind of "automation" interface.

> So perhaps the question is, how does one write a wrapper for using a library
> with python? (I see there is a xmms wrapper, but I don't have X installed,
> so I assume that that is not an option) again, on win32, it is simple enough
> to use either windll or even vb to declare non-COM functions and write COM
> wrappers to them.  Where would I look to do this on unix?

If you really want to use a COM-style automation interface, then the
easiest thing might be to check the documentation for the various
players to see what facilities they provide. On KDE, you might want to
check the Noatun documentation, and then look up DCOP in your manuals.

[...]

> > Most likely, mpg123 is available on your system as well.
> 
> Indeed as I installed it last night :)

One thing to note for readers of this thread is that mpg123 may not
necessarily be available on various recent Linux distributions due to
the patent uncertainties around MP3 software. Still, there's always
ogg123 for those of us who are using Ogg Vorbis instead, and
controlling that player using os.system (as others have proposed)
should be reasonably straightforward, especially since it responds to
various UNIX signals, too.

Paul



More information about the Python-list mailing list