Transform the string to bytes

This commit is contained in:
N07070 2020-01-14 16:54:50 +01:00
parent b2ec27701e
commit 4ab8effc57

View File

@ -97,7 +97,7 @@ def print_text():
printer = Adafruit_Thermal('/dev/serial0', 19200, timeout=5)
printer.begin()
printer.justify('L')
printer.println(request.form['message'])
printer.println(request.form['message'].encode('latin-1'))
printer.setSize('S')
printer.println(">> " + datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " " + session.get('user'))
printer.justify('C')