您所做的是pytesser.py
在主pytesser
文件夹中打开并更改此功能:
def call_tesseract(input_filename, output_filename):
"""Calls external tesseract.exe on input file (restrictions on types),
outputting output_filename+'txt'"""
args = [tesseract_exe_name, input_filename, output_filename]
proc = subprocess.Popen(args)
retcode = proc.wait()
if retcode!=0:
errors.check_for_errors()
至
def call_tesseract(input_filename, output_filename):
"""Calls external tesseract.exe on input file (restrictions on types),
outputting output_filename+'txt'"""
devnull = open(os.devnull, 'w')
args = [tesseract_exe_name, input_filename, output_filename]
proc = subprocess.Popen(args, stderr=devnull)
retcode = proc.wait()
if retcode!=0:
errors.check_for_errors()
并添加import os
到文件的顶部。