if getattr(sys, 'frozen', False):
    dllname = None
elif __file__:
    dllname = os.path.dirname(__file__)
ntl = logging.handlers.NTEventLogHandler('Python Logging Test', dllname=dllname
    )
NTEventLogHandler from a Python executable