import socket network = 'irc.insert.a.network.here' port = 6667 irc = socket.socket ( socket.AF_INET, socket.SOCK_STREAM ) irc.connect ( ( network, port ) ) irc.send ( 'NICK PyIRC\r\n' ) irc.send ( 'USER PyIRC PyIRC PyIRC :Python IRC\r\n' ) irc.send ( 'JOIN #pyirc\r\n' ) irc.send ( 'PRIVMSG #pyirc :Can you hear me?\r\n' ) irc.send ( 'PART #pyirc\r\n' ) irc.send ( 'QUIT\r\n' ) irc.close() 結構簡単ですねww
![2008-01-06](https://cdn-ak-scissors.b.st-hatena.com/image/square/06a15c64ba0ceec233d86d71001ebb29a9dcbf5d/height=288;version=1;width=512/https%3A%2F%2Fcdn.blog.st-hatena.com%2Fimages%2Ftheme%2Fog-image-1500.png)