Python IRC

Bir irc uygulaması yazmayı düşünüyorum. Biraz göz attım, araştırdım ne nasıl oluyor diye. Şimdilik aşağıdaki kodları oluşturdum. Bir kanala mesajı yazıp kaçıyorsunuz sadece :)

import socket

network =’irc.zurna.net’
kanal = ‘#harakiri’
rumuz = ‘omer__’
port = 6667

irc = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print irc.connect((network,port))
print irc.send(’NICK %s\r\n’ %(rumuz))
print irc.send(’USER %s %s %s : Python\r\n’ %(rumuz,rumuz,rumuz))
print irc.send(’JOIN %s\r\n’ %(kanal))
print irc.send(’PRIVMSG %s :Merhaba omer\r\n’ %(kanal))
print irc.send(’PART %s\r\n’ %(kanal))
print irc.send(’QUIT\r\n’)
irc.close()

1 comment so far

  1. dinosaur fact on

    Stumbled upon your blog a week ago and decided to come back. Not for the articles you write, but for how you write them, really amazing stuff you’re doing here, i like how you put information into the articles which makes it much more easier to read and much more interesting of course. Keep up the good work!


Leave a reply