使用qrcode库,代码如下:

#!/usr/bin/env python
# -*- coding: utf-8 -*-  

'''
author: xjump.me#gmail.com
reference: 
    https://pypi.python.org/pypi/qrcode
'''

import qrcode
qr = qrcode.QRCode(
    version=1,
    error_correction=qrcode.constants.ERROR_CORRECT_L,
    box_size=10,
    border=4,
)

data = '''https://xjump.me/item?id=20202220&bizId=Zi8789341324&d
escription=this is a demo item.this is a demo item.this is a demo 
item.this is a demo item.this is a demo item.this is a demo item.
this is a demo item.this is a demo item.this is a demo item.this 
is a demo item.this is a demo item.this is a demo item.this is a 
demo item.this is a demo item.this is a demo item.this is a demo 
item.this is a demo item.this is a demo item.this is a demo item.
this is a demo item.this is a demo item.this is a demo item.this 
is a demo item.this is a demo item.this is a demo item.this is a 
demo item.this is a demo item.this is a demo item.this is a demo 
item.this is a demo item.this is a demo item.this is a demo item.
this is a demo item.this is a demo item.this is a demo item.this 
is a demo item.this is a demo item.this is a demo item.this is a 
demo item.this is a demo item.this is a demo item.this is a demo 
item.this is a demo item.this is a demo item.this is a demo item.
this is a demo item.this is a demo item.this is a demo item.this 
is a demo item.this is a demo item.this is a demo item.this is a 
demo item.this is a demo item.'''

qr.add_data(data)
print len(data)
qr.make(fit=True)

img = qr.make_image()
img.show()