diff --git a/Makefile b/Makefile index 2aadf62..2421755 100644 --- a/Makefile +++ b/Makefile @@ -88,12 +88,14 @@ output/chatbot.txt: ocr/output.txt ## Comments a text with a simple chatbot. Dep output/n7.txt: ocr/output.txt ## Replaces nouns with the 7th noun that follows. Dependencies: 91k_nouns cat $< | python3 src/n_7.py > $(@) -output/carlandre.txt: ocr/output.txt ## Alice: Creates visual poetry out of a text. Dependencies: pytest - cat $< | python3 src/carlandre.py > $(@) +carlandre: ocr/output.txt ## Alice: Creates visual poetry out of a text. Dependencies: pytest + @python3 src/carlandre.py +.PHONY: carlandre # cat $(@) > /dev/usb/lp0 -output/overunder: ocr/output.txt ## Alice: An interpreted language that translate simple weaving instructions and creates a weaving pattern on text. - python3 src/overunder.py +overunder: ocr/output.txt ## Alice: An interpreted language that translate simple weaving instructions and creates a weaving pattern on text. + @python3 src/overunder.py +.PHONY: overunder visualization: $(images) $(tmpfile) ##Creates data visualization from images/*.jpg. Dependencies: mplayer diff --git a/src/carlandre.py b/src/carlandre.py index 43df4eb..2746f92 100644 --- a/src/carlandre.py +++ b/src/carlandre.py @@ -115,15 +115,14 @@ if __name__ == '__main__': my_path = '/dev/usb/lp0' if os.path.exists(my_path): sys.stdout = open(my_path, 'w') + escpos = { + "init_printer": "\x1B\x40", + 'papercut':'\x1D\x56\x00', + } - - -escpos = { - "init_printer": "\x1B\x40", - 'papercut':'\x1D\x56\x00', -} - -for i in range(10): print(escpos['init_printer']) print(joined_list) + print(emptylines) print(escpos['papercut']) +else: + print(joined_list, '\nThis is all I can do for now, since you don\'t have a printer.')