Raspberry Pi Guia Del Usuario página 166

Ocultar thumbs Ver también para Pi:
Tabla de contenido

Publicidad

user = {
'nick' : 'botnick',
'username' : 'botuser',
'hostname' : 'localhost',
'servername' : 'localhost',
'realname' : 'Raspberry Pi Names Bot'
}
realname
hostname servername
socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print 'Connecting to %(host)s:%(port)s...' % irc
try:
s.connect((irc['host'], irc['port']))
except socket.error:
print 'Error connecting to IRC server %(host)s:%(port)s' % irc
sys.exit(1)
try
except
s.connect
port
s.send('NICK %(nick)s\r\n' % user)
s.send('USER %(username)s %(hostname)s %(servername)s :%(realname)s\r\n' % user)
s.send('JOIN %(channel)s\r\n' % irc)
s.send('NAMES %(channel)s\r\n' % irc)
send
irc
socket
irc
send
socket
username hostname servername realname
nick
-bot
localhost
print
nick
user
username
host

Publicidad

Tabla de contenido
loading

Tabla de contenido