from socket import * import pysfbot_main, time s = socket(AF_INET, SOCK_STREAM) s.connect(('irc.freenode.net', 6667)) channel = '#python-dev' f = s.makefile('wb', 0) g = s.makefile('rb', 0) f.write('NICK sf_number\n\r') f.write('USER localhost localhost localhost :Bot getting the title of SF bugs and patches \n\r') f.write('JOIN %s\n\r' % channel) while 1: try: reload(pysfbot_main) pysfbot_main.main(f, g, channel) except KeyboardInterrupt: print '*'*60 print 'Reloading in 2 seconds...' time.sleep(2)