系统:windows 7语言版本:anaconda3-4.3.0.1-windows-x86_64编辑器:pycharm-community-2016.3.2
这个系列就是整个好玩的今天就是根据Excel中的信息生成一堆二维码Part 1:目标

Excel内容

生成的二维码

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

<pre class="brush:php;toolbar:false;">import qrcodeimport osfrom openpyxl import load_workbookexcel_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()
以上就是fun-二维码的世界-说不定可以用来表白的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号