Python pyBarcode-imageWriter设置
我正在使用pyBarcode和Python2.7制作code128条形码。这段代码成功地生成了条形码,但默认情况下,我不知道如何更改它。这些选项参数不会改变任何内容。谢谢Python pyBarcode-imageWriter设置,python,python-2.7,barcode,code128,Python,Python 2.7,Barcode,Code128,我正在使用pyBarcode和Python2.7制作code128条形码。这段代码成功地生成了条形码,但默认情况下,我不知道如何更改它。这些选项参数不会改变任何内容。谢谢 def createBarcode(self,mac,saveas): # Create new instance try: ean = barcode.get('code128', mac, writer=ImageWriter()) ean.default_write
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)
你能找到解决办法吗?