You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
769 B
Python

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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")
fantasyname = open("image.txt" , "r")
fantasyname = fantasyname.readlines()
text = open("image.txt", "r").read()
text = text.replace("","'")
text = text.replace("","'")
print(text)
print("------")
lines = text.split("\n")
for line in lines:
dotprint = "echo "+line+" >/dev/usb/lp0"
os.system(dotprint)
#for line in fantasyname:
#line = line.split(" ")
#for l in line:
#if l!="" or l != ['\n', '\r\n']:
#print(l)
#os.system("echo '"+l+"' > /dev/usb/lp0")