瀏覽代碼

Add script for labeling a single mice toilet box

Mario Hüttel 2 年之前
父節點
當前提交
6f2caf0d49
共有 1 個文件被更改,包括 25 次插入0 次删除
  1. 25 0
      print_single_mice.py

+ 25 - 0
print_single_mice.py

@@ -0,0 +1,25 @@
+#!/bin/python
+
+import shimatta_label.label_image as li
+import shimatta_label.brother_ql_wrapper as ql_wrapper
+import sys
+
+printer_model = 'QL-800'
+printer_connection = 'usb://0x04f9:0x209b'
+
+if len(sys.argv) < 4:
+	print(f'Usage: {sys.argv[0]} <Heading> <Line2> <Line3>')
+	heading = input('First (Bold Heading) Line:')
+	line2 = input('Second Line:')
+	line3 = input('Third line:')
+else:
+	heading = sys.argv[1]
+	line2 = sys.argv[2]
+	line3 = sys.argv[3]
+
+label = li.MiceToiletLabel()
+label.put_text(heading, line2, line3)
+
+printer = ql_wrapper.BrotherQlPrinter(model=printer_model, printer_connection=printer_connection, label_format='12')
+printer.print_image(label.get_pillow_image(), cut=True, rotation=270)
+