import jabber def presenceCB(con, prs): who = str(prs.getFrom()) type = prs.getType() if type == None: type = "available" print "Who: %s" % (who) print "Type: %s" % (type) def messageCB(con, prs): print "Who: %s" % (str(prs.getFrom)) con = jabber.Client(host="localhost", debug=True) con.setPresenceHandler(presenceCB) con.setMessageHandler(messageCB) con.connect() con.auth("horariod", "secret", "python") print "Conected..." con.sendInitPresence() while(1): con.process(3)