def __init__(self, config):
        self.lang = 'eng'
        self.required = "3.02.02"
        self.threads = config.get('threads',4)

        if "binary" in config:  # Override location of binary
            binary = config['binary']
            if os.name == 'nt':
                binary = '"%s"' % binary
                binary = binary.replace("\\", "\\\\")
            logging.info("Setting location for tesseracdt executable to %s" % (binary))
        else:
            if str(os.name) == 'nt':
                # Explicit str here to get around some MagicMock stuff for testing that I don't quite understand
                binary = '"c:\\Program Files (x86)\\Tesseract-OCR\\tesseract.exe"'
            else:
                binary = "tesseract"

        self.binary = binary

        self.msgs = {
            'TS_MISSING': """ 
                Could not execute %s
                Please make sure you have Tesseract installed correctly
                """ % self.binary,
            'TS_VERSION':'Tesseract version is too old',
            'TS_img_MISSING':'Cannot find specified tiff file',
            'TS_FAILED': 'Tesseract-OCR execution failed!',
        }
Detect windows tesseract location.
dataset/ETHPy150Open virantha/pypdfocr/pypdfocr/pypdfocr_tesseract.py/PyTesseract.__init__