From 909828f5286a1bb3adf975a6c6c3f207a08a6098 Mon Sep 17 00:00:00 2001 From: Zihan Chen Date: Fri, 26 Aug 2016 23:11:24 -0700 Subject: [PATCH] Fixed delete tmp.txt failure in Windows --- pytesser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytesser.py b/pytesser.py index cdbdf62..84fbea3 100644 --- a/pytesser.py +++ b/pytesser.py @@ -78,6 +78,7 @@ def image_to_string(file,lang=None, psm=None): process_request(file, TEMP_FILE, lang, psm) #Process command f = open(TEMP_FILE+".txt","r") #Open back the file txt = f.read() + f.close() os.remove(TEMP_FILE+".txt") return txt