删除 python barcode.py 库中条形码下方的文本

Remove text below barcode in python barcode.py library

有谁知道如何删除条形码下方的文字?条形码是使用 barcode.py 库生成的。我试图签入 https://bitbucket.org/whitie/python-barcode 但找不到解决方案,应该在 python:

的条形码保存行中写入哪些属性
ean = barcode.get('code39', str(row['PART']), writer=ImageWriter())

附上带有标记线的条形码图片,我想从条形码生成中删除。

查看代码,您似乎可以将属性 'human'(人类可读文本)设置为非空字符串以覆盖底部的文本。如果将其设置为带有单个空格的字符串,' ',文本将为空。

试试这个: barcode.default_writer_options['write_text'] = 假

这就是解决方案

import barcode
from barcode.writer import ImageWriter
ITF = barcode.get_barcode_class('itf')
itf = ITF('30573190692203003169482900832115201911297', writer=ImageWriter())
fullname = itf.save('itf_barcode', options={"write_text": False})

如果导入“条码”,解决方法是:

import barcode
barcode.base.Barcode.default_writer_options['write_text'] = False