from time import sleep import config as cfg from irc import IRC from ramen import Ramen irc = IRC() irc.is_debug(cfg.debug) socket = irc.connect(cfg.server, cfg.bot_nick) irc.join_channels(cfg.channels) ramen = Ramen() # Have run.py and ramen.py share the same socket connection ramen.attach(socket) while 1: sleep(2) data = irc.receive(debug=cfg.debug) irc.keep_alive(data) for chan in cfg.channels: ramen.handle(chan, data)