Re: how to get information of a running prog in python



On May 12, 11:02 pm, Jimmy <mcknight0...@xxxxxxxxx> wrote:
On May 13, 10:36 am, "Dan Upton" <up...@xxxxxxxxxxxx> wrote:



On Mon, May 12, 2008 at 10:19 PM, Jimmy <mcknight0...@xxxxxxxxx> wrote:
Well, i know it may be a little non-python thing, however, I can think
 of no place better to post this question :)

 can anyone tell me, in python, how to obtain some information of a
 running program?
 paticularly, if i am playing some music in audacious or other media
 player, how can i get the the name and some other info of current
 playing song? It seems that audicious doesn't output on run-time
 --
 http://mail.python.org/mailman/listinfo/python-list

In most cases, you'll probably need some sort of API, either in the
program itself or through some sort of plugin, that lets external
programs query it.  For instance, there are some plugins to WinAmp
that allow external programs (like Last.FM or Mog-O-Matic) to see what
track is currently playing.  You may also be able to do something like
get the window title (again, WinAmp's title bar usually includes the
artist and title) and parse it out.  I don't really know that there's
anything specific to Python for accessing these though, and it may
vary depending on media player.

Just my two cents...

-dan

thanks!

In linux, I am always obfuscated by sort of APIs. Like how to get
title information of a running program?
where am I supposed to find these APIs

I think you're a little confused about how computers work in general
and what a program can do, and you expect there is some general
superprogram able to decipher what an arbitrary other running program
does. The sentence "how to get title information of a running program"
doesn't even make sense for most programs since they don't play music
anyway.

Your best bet is if the *specific* program you're interested in (e.g.
audacious) exposes this information programmatically in some way. It's
up to the developers of this application if and how they choose to do
it. Even if they do it, there's no requirement that the same API will
work for any other program of the same category, unless there is some
popular industry standard that most applications implement.

In short, you'll get more helpful replies at the audacious newsgroup.

HTH,
George
.



Relevant Pages

  • Re: how to get information of a running prog in python
    ... if i am playing some music in audacious or other ... and it may vary depending on media player. ... I am always obfuscated by sort of APIs. ... information of a running program? ...
    (comp.lang.python)
  • Re: how to get information of a running prog in python
    ... if i am playing some music in audacious or other media ... vary depending on media player. ... title information of a running program? ...
    (comp.lang.python)
  • Re: WMPlayer 10 freezes up!
    ... Now Playing: "Cabbagetown" by "They Might Be Giants" in Windows Media ... >> been with new media added since the addition of WMP10. ... >>> I had problems installing WMPlayer 10. ...
    (microsoft.public.windowsmedia.player)
  • Re: Media Centre Slowing Down
    ... Tried loading another CD to the Media Centre whilst an archieved disk was ... playing, and the playing tune slowed down / stopped. ... Does turning off Virus guard have any effect? ...
    (microsoft.public.windows.mediacenter)
  • Re: What PVR are you using?
    ... playing of encrypted BluRay discs requires use ... I would have built a media PC if SWMBO was not in a hurry to ... If you wish your postings to be seen by ...
    (uk.tech.digital-tv)