我正在使用 pyBarcode 和 Python 2.7 制作 code128 条形码。此代码成功制作条形码,但默认情况下,我无法弄清楚如何更改它。这些选项参数不会改变任何东西。谢谢
def createBarcode(self,mac,saveas):
# Create new instance
try:
ean = barcode.get('code128', mac, writer=ImageWriter())
ean.default_writer_options['module_width'] = 0.2
ean.default_writer_options['module_height'] = 11
ean.default_writer_options['quit_zone'] = 1
ean.default_writer_options['text_distance'] = 2
filename = ean.save(saveas)