使用barcode.ps和pil/枕头生成各种条形码
elaphe的Python项目详细描述
elaphe是纯postscript中条形码编写器的python绑定 (http://www.terryburton.co.uk/barcodewriter/)。
要求
- Python2.7。不适用于Python3。
- 系统上的鬼脚本
简单用法
以下示例:
>>> from elaphe import barcode >>> barcode('qrcode', ... 'Hello Barcode Writer In Pure PostScript.', ... options=dict(version=9, eclevel='M'), ... margin=10, data_mode='8bits')) # Generates PIL.EpsImageFile instance <PIL.EpsImagePlugin.EpsImageFile ... at ...> >>> _.show() # Show rendered bitmap
将在系统上调用图像查看器,显示一个带10px边距的qrcode符号。 barcode()返回PIL图像对象。