1
我用xmpp寫了應用程序。它使用gtalk發送消息。我想打印收到的消息。我能怎麼做?我的應用程序短代碼如下。python-xmpp收到消息
def process_message():
client = xmpp.Client('gmail.com')
client.connect(server=('talk.google.com',5223))
client.auth(user,passwd, 'botty')
to = raw_input("to: ");
if client:
message = raw_input("message: ")
client.send(xmpp.Message(to,message))
if __name__ == "__main__":
user = raw_input("User: ")
passwd = getpass.getpass("Pass: ")
process_message()