pyBarcode - imageWriter设置

时间:2018-05-10 07:08:50

标签: python python-2.7 barcode code128

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

0 个答案:

没有答案