Не пинайте сильно, я питон начала учить недавно. Вопрос в общем вот в чем. Нужен простенький ботик, который для начала будет хотя бы заходить в сеть. Нашла в сети полно исходников. Но проблема в том что получаю ошибку "/usr/lib/python2.6/dist-packages/xmpp/auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha,base64,random,dispatcher,re /usr/lib/python2.6/dist-packages/xmpp/auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5 " Смысл я поняла, что одни модули устарели и вместо них нужно использовать другие, вот только как? Вот один из исходников: Code: import sys, xmpp class JabberBot: def __init__ (self, jid, password): jid = xmpp.JID(jid) self.user, self.server, self.password = jid.getNode(), jid.getDomain(), password self.connect() self.auth() def connect(self): self.conn = xmpp.Client(self.server, debug = []) conres = self.conn.connect() if not conres: print "Unable to connect to server %s!" % server sys.exit(1) if conres <> 'tls': print "Warning: unable to estabilish secure connection - TLS failed!" def auth(self): authres = self.conn.auth(self.user, self.password) if not authres: print "Unable to authorize on %s - check login/password." % server sys.exit(1) if authres <> 'sasl': print """Warning: unable to perform SASL auth os %s. Old authentication method used!""" % server def register_handler(self, name, handler): self.conn.RegisterHandler(name, handler) def step_on(self): try: self.conn.Process(1) except KeyboardInterrupt: return 0 return 1 def start(self): self.conn.sendInitPresence() print 'Bot started!' while self.step_on(): pass
s.jealousy на варнинги DeprecationWarning можно не обращать внимание. В качестве либы для работы с джаббером рекомендую SleekXMPP