msnp, friends list

Mark Rowe mail.python.org at bdash.net.nz
Thu Feb 17 15:24:05 EST 2005


On Feb 18, 2005, at 7:31 AM, jr wrote:

> I'm currently using the msnp.py code from Manish Jethani's project. I
> havn't been able to get the friends list to update like it should. it
> works once out of about every 25 times the program loads.
>
> Has anyone been able to implement his code and get the friends list to
> actively update? Or have any suggestions?

I just spent a few minutes experimenting, and it seems that the 
following code does what you would like:

import msnp
import time

class MsnListener(msnp.SessionCallbacks):
     def friend_list_updated(self, friend_list):
         print 'Got friend list update:', friend_list.lists

msn = msnp.Session(MsnListener())
msn.login('xxxxxxxx at xxxx.com', 'xxxxxxx')
msn.sync_friend_list()

while True:
     msn.process()
     time.sleep(1)

> Any info would be great.
> Thanks.

Hope this helps,

Mark Rowe
<http://bdash.net.nz/>




More information about the Python-list mailing list