import configparser import sys from inspect import getsourcefile from os.path import abspath, dirname, join, realpath import __init__ # Hack to auto-detect the current diectory and add it to the python path scriptpath = dirname(realpath(abspath(getsourcefile(lambda:0)))) parent = dirname(scriptpath) conf = configparser.ConfigParser() conf.read(join(parent, 'config.ini')) d = __init__.Daemon(conf) d.do_processing()