python on unix [getting started]

Martin v. Loewis martin at v.loewis.de
Sun Nov 17 03:17:35 EST 2002


"dsavitsk" <dsavitsk at e-coli.net> writes:

> In particular, I would like to control mpg123 (i think?).  what is the
> proper way to think about doing something like
> 
> player = win32com.client.Dispatch('mpg123.player')
> player.play('/usr/home/mp3/Some Song.mp3')
> 
> on unix?  perhaps, where is the proper place to look to start learning about
> this. any books, or websites, or pieces of code to look at?

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:

a) invoke a program that somebody else has written. Using programs is
way more common on Unix than on Windows, it is Unix philosophy to
combine "utilities" into applications.

b) use a library that somebody else has written. In this case, you
need to find a Python wrapper for the library - which either may
already exist, or needs to be written.

"On Unix", playing mp3 files is not supported. Instead, different Unix
systems have different ways of playing mp3 files - some do not support
it at all. So you need to find out what Unix you use (invoke uname for
that), then you need to contact an appropriate newsgroup dealing with
that system specifically.

Most likely, mpg123 is available on your system as well. It is a
command line utility.

Regards,
Martin



More information about the Python-list mailing list