Skip to content

Commit f2680c4

Browse files
[投稿] 添加脚本: 二维码生成器 — by 爱玩Arduino
1 parent 31129e5 commit f2680c4

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import qrcode
2+
3+
qr = qrcode.QRCode(
4+
version=1,
5+
error_correction=qrcode.constants.ERROR_CORRECT_L,
6+
box_size=10,
7+
border=4,
8+
)
9+
10+
qr.add_data("https://doubao.com")
11+
qr.make(fit=True)
12+
13+
# 前景黑,背景白
14+
img = qr.make_image(fill_color="black", back_color="white")
15+
img.save("qr_custom.png")

0 commit comments

Comments
 (0)