python-printer-escpos
python-printer-escpos copied to clipboard
NameError: name 'serial' is not defined
Trying to define my printer object like this:
from escpos.connections import getSerialPrinter
printer = getSerialPrinter()(dev='/dev/ttyUSB0',
baudrate=9600,
bytesize=8,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
timeout=1.00,
dsrdtr=True)
I get the following error:
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
NameError: name 'serial' is not defined
Any ideas?