Add printer code
This commit is contained in:
parent
51d8ada1d8
commit
6b905ef5e5
|
@ -0,0 +1,17 @@
|
||||||
|
import StarTSPImage
|
||||||
|
from PIL import Image, ImageDraw, ImageFont, ImageOps
|
||||||
|
import textwrap
|
||||||
|
import random
|
||||||
|
|
||||||
|
def printer():
|
||||||
|
im = Image.new("RGB", (800, 1280), (0, 0, 0))
|
||||||
|
|
||||||
|
# im.show()
|
||||||
|
|
||||||
|
raster = StarTSPImage.imageToRaster(im, cut=True)
|
||||||
|
|
||||||
|
printer = open('/dev/usb/lp0', "wb")
|
||||||
|
printer.write(raster)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
printer()
|
Loading…
Reference in New Issue