python-printer-escpos icon indicating copy to clipboard operation
python-printer-escpos copied to clipboard

NameError: name 'serial' is not defined

Open nickshanks347 opened this issue 3 years ago • 0 comments

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?

nickshanks347 avatar Jan 17 '22 09:01 nickshanks347