A little PYTHON code for basic barcode checking before using an ESC/POS printer barcode renderig function. This ensures the barcode will be renderer correctly.
Note that most ESC/POS printers, such as the Epson TM T20ii, don't usually bother
with the checksums and stuff; they only care about the character set and the length
of the string. There are also some special formats, for example the CODE128 should be
prefixed with {B
for alphanumeric barcodes, etc.