Így néz ki (skype4py kell hozzá):
#!/usr/bin/python
import Skype4Py
import pydcop
import time
amarok = pydcop.DCOPApplication( "amarok" )
skype = Skype4Py.Skype()
skype.Attach()
while True:
artist = amarok.player.artist()
title = amarok.player.title()
album = amarok.player.album()
if amarok.player.isPlaying():
skype.CurrentUserProfile.MoodText = "%s: %s" % (artist, title)
else:
skype.CurrentUserProfile.MoodText = "Nem fut lejatszo."
time.sleep(3)
Erősen bugzik, mert az ékezetekkel nem tudtam mit kezdeni az utf8 miatt. Egyre jobban tetszik a python. 🙂
akkor ajánlom figyelmedbe a decode(), ill. encode() sztringmetódusokat, és máris rájössz, hogy mégsem olyan szép nyelv ez a python 🙂