from refill import opt_parse,MProfitRatioCalc import signal as sig import logging logging.basicConfig(filename='/var/www/html/data/log/statcalc.log', format='%(levelname)10s %(asctime)s %(name)10s %(thread)d %(message)s', level=logging.DEBUG) log = logging.getLogger('profit_ratio') if __name__ == '__main__': try: rhost, rhost = opt_parse() calc = MProfitRatioCalc() calc.set_redis(rhost,rport) sig.signal(sig.SIGINT, lambda: calc.stop()) calc.run() except Exception as ex: log.error(ex)