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.
94 lines
2.7 KiB
Python
94 lines
2.7 KiB
Python
7 years ago
|
import sys
|
||
|
from time import sleep
|
||
|
sys.stdout = open('/dev/usb/lp0', 'w')
|
||
|
title = 'art'
|
||
|
art = """
|
||
|
|
||
|
_/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
|
||
|
\__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \_
|
||
|
__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
|
||
|
\__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \_
|
||
|
__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
|
||
|
\__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \_
|
||
|
__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
|
||
|
\__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \_
|
||
|
|
||
|
////over/under instructions
|
||
|
|
||
|
|
||
|
////Run 'make overunder'
|
||
|
|
||
|
////Start by loading your text.
|
||
|
|
||
|
////To load your text, type 'load'.
|
||
|
|
||
|
////To see the line you are currently on, type 'show'.
|
||
|
|
||
|
////To start your pattern, type 'over' or 'under'.
|
||
|
|
||
|
////Follow each by an integer, separated by a comma.
|
||
|
|
||
|
////e.g. over 5, under 5, over 6, under 10
|
||
|
|
||
|
////To move on to the next line, press enter twice.
|
||
|
|
||
|
////To see your pattern, type 'pattern'.
|
||
|
|
||
|
////To save your pattern in a text file, type 'save'.
|
||
|
|
||
|
////To leave the program, type 'quit'.
|
||
|
|
||
|
_/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
|
||
|
\__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \_
|
||
|
__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
|
||
|
\__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \_
|
||
|
__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
|
||
|
\__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \_
|
||
|
__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
|
||
|
\__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \_
|
||
|
|
||
|
"""
|
||
|
|
||
|
|
||
|
escpos = {
|
||
|
"init_printer": "\x1B\x40",
|
||
|
|
||
|
"justify_left": "\x1B\x61\x00",
|
||
|
"justify_center": "\x1B\x61\x01",
|
||
|
|
||
|
'halfwidth_on': "\x1B\x21\x01",
|
||
|
'halfwidth_off': "\x1B\x21\x00",
|
||
|
|
||
|
'doubleprinting_on': "\x1B\x47\x01",
|
||
|
'doubleprinting_off': "\x1B\x47\x00",
|
||
|
|
||
|
'emphasis_on': '\x1B\x45\x01',
|
||
|
'emphasis_off': '\x1B\x45\x00',
|
||
|
|
||
|
'largefont': "\x1B\x21\x90", # 0=None 70=very lage+intalic, 90= medium large
|
||
|
'mediumfont': "\x1B\x21\x90",
|
||
|
'normalfont': "\x1B\x21\x00",
|
||
|
|
||
|
'space_btw_letters': '\x1B\x20\x01', # n [0,255]
|
||
|
|
||
|
'feedamount': '\x1B\x33\x09', #?
|
||
|
|
||
|
'paperfeed': '\x1B\x4A\x01' , #??
|
||
|
'papercut':'\x1D\x56\x00',
|
||
|
|
||
|
'direction_0': '\x1B\x56\x00' ,
|
||
|
'direction_90': '\x1B\x56\x01' ,
|
||
|
|
||
|
'pagedefault': '\x1B\x53' , #?
|
||
|
}
|
||
|
|
||
|
print(escpos['init_printer'])
|
||
|
print(escpos['doubleprinting_on'])
|
||
|
print(art)
|
||
|
print(escpos['largefont'])
|
||
|
print(escpos['justify_center'])
|
||
|
print(escpos['normalfont'])
|
||
|
print(escpos['justify_left'])
|
||
|
print(escpos['justify_center'])
|
||
|
print(escpos['papercut'])
|