Code128().getImage(val, path='./')
data = b64encode(open(val + '.png').read())
print('<img src="data:image/png;base64,{0}">'.format(data))
Reportlab's Code128 Barcode as HTML Image Tag with Data URI Scheme in Python