From bf525f4fc2ca8f40cd2910abc8d2da83d6d25ef5 Mon Sep 17 00:00:00 2001 From: cutting Date: Tue, 29 Nov 2022 18:06:18 +0000 Subject: [PATCH] ' --- cutting.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cutting.py b/cutting.py index 61d9375..aa8a470 100644 --- a/cutting.py +++ b/cutting.py @@ -1,19 +1,22 @@ import os print("starting the pruning process") -scanning = "scanimage --resolution 300 --mode gray --format png > image.png" -os.system(scanning) -os.system("convert -contrast image.png output.png") -os.system("tesseract output.png image -l eng") +#scanning = "scanimage --resolution 300 --mode gray --format png > image.png" +#os.system(scanning) +#os.system("convert -contrast image.png output.png") +#os.system("tesseract output.png image -l eng") fantasyname = open("image.txt" , "r") fantasyname = fantasyname.readlines() text = open("image.txt", "r").read() -text = text.replace("‘","'") -text = text.replace("’","'") +text = text.replace(b'\xe2\x80\x98'.decode(), "'") +text = text.replace(b'\xe2\x80\x99'.decode(), "'") +text = text.replace(b'\xe2\x80\x9d'.decode(), "'") +text = text.replace(b'\xe2\x80\x9c'.decode(), "'") + print(text) print("------") lines = text.split("\n") for line in lines: - dotprint = "echo "+line+" >/dev/usb/lp0" + dotprint = f'echo "{ line }" > /dev/usb/lp0' os.system(dotprint) #for line in fantasyname: #line = line.split(" ")