我正在使用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)