系统:Windows 7 语言版本:Anaconda3-4.3.0.1-Windows-x86_64 编辑器:pycharm-community-2016.3.2
Part 1:目标

Excel内容

生成的二维码

不期而至的大雨
Part 2:代码

import qrcode
import os
from openpyxl import load_workbook
excel_address = r"E:\Coding\E_PythonWriting\something_fun\二维码.xlsx"
erweima_address = r"E:\Coding\E_PythonWriting\something_fun\二维码"
wb = load_workbook(excel_address)
sht = wb["夏日终曲"]
qr = qrcode.QRCode(version=5, error_correction=qrcode.constants.ERROR_CORRECT_H,
box_size=10, border=5)
for i in range(1, 11):
each_row = sht["A" + str(i)].value
qr.add_data(each_row)
qr.make(fit=True)
img = qr.make_image(fill_color="black", back_color="white")
img_name = "{0}.png".format(i)
img_address = os.path.join(erweima_address, img_name)
img.save(img_address)
qr.clear()
print("已输出全部")
代码截图

Part 3:部分代码解读

qr.add_data(each_row)增加内容img.save(img_address)另存为图片qr.clear()清空内容,务必要增加这一句话,要不会叠加。
就是第2个二维码对应的内容为不期而至的大雨将我们困在一起,就是对应第1+2行