To install Skype4Py just use setup tools and easy_install:
$ sudo easy_install Skype4PyHere's a quick snippet that displays the users from your friend list that currently have a status that is not included in the badStatusCodes list. It's not much and doesn't perform any error handling but it shows just how easy it is to get started using this library.
import Skype4Py s = Skype4Py.Skype() s.Attach() badStatusCodes = ['UNKNOWN', 'OFFLINE', 'DND', 'LOGGEDOUT'] availFriends = [] for f in s.Friends: if not f.OnlineStatus in badStatusCodes: availFriends.append(f) print "%s, %s" % (f.FullName, f.OnlineStatus)It seems like quite a useful tool if you are into IP telephony or just want to screw around with creating Skype bots and the like.
Unfortunately Skype4Py doesn't work 100% on OS X because of an issue with threading (and I'm a mac user). For example, if I try to place a call using s.PlaceCall(number) it says that the thread can only be started one time
>>> s.PlaceCall() Traceback (most recent call last): File "The following resources are very helpful when working with Skype4Py:", line 1, in File "build/bdist.macosx-10.3-fat/egg/Skype4Py/skype.py", line 691, in PlaceCall File "build/bdist.macosx-10.3-fat/egg/Skype4Py/skype.py", line 877, in _GetActiveCalls File "build/bdist.macosx-10.3-fat/egg/Skype4Py/skype.py", line 339, in _Search File "build/bdist.macosx-10.3-fat/egg/Skype4Py/skype.py", line 276, in _DoCommand File "build/bdist.macosx-10.3-fat/egg/Skype4Py/skype.py", line 778, in SendCommand File "build/bdist.macosx-10.3-fat/egg/Skype4Py/api/darwin.py", line 374, in send_command File "build/bdist.macosx-10.3-fat/egg/Skype4Py/api/darwin.py", line 327, in attach File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 467, in start raise RuntimeError("threads can only be started once") RuntimeError: threads can only be started once
No comments:
Post a Comment