
Untitled
By: a guest on
Apr 20th, 2012 | syntax:
None | size: 0.68 KB | hits: 6 | expires: Never
while 1:
try: #make sure you put add the except, or remove this try. i have it msg a channel when it errors, or print the error.
try:
self.irc.send('\r\n') #makes sure the connection is still alive, but doesnt actually send anything..
self.data = self.extra+self.irc.recv(1024) #make sure self.extra is pre-set to ''
self.data = self.data.replace("\r",'').split("\n")
self.extra = self.data.pop()
except socket.error:
sock = ''
self.irc.close()
exit()
for self.line in self.data:
if self.line != '':
self.line = self.line.split(" ")
#self.line[0] would be the first word of the line being sent from the server.