print_single_mice.py 707 B

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