Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3a5f735

Browse files
committed
提交代码
1 parent a749b14 commit 3a5f735

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

‎xianhuan/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Python技术 公众号文章代码库
1010

1111
## 实例代码
1212

13+
[一行代码,生成和读取二维码!](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/qrcode):一行代码,生成和读取二维码!
14+
1315
[用 Python 写最简单的摸鱼监控进程,你会吗?](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/monitor):用 Python 写最简单的摸鱼监控进程,你会吗?
1416

1517
[用Python对摩斯密码加解密!](https://github.com/JustDoPython/python-examples/tree/master/xianhuan/morse): 用Python对摩斯密码加解密!

‎xianhuan/qrcode/qrcodedemo.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
@author: 闲欢
5+
"""
6+
import qrcode
7+
import cv2
8+
9+
img = qrcode.make('https://www.zhihu.com/people/wu-huan-bu-san')
10+
img.save('./pic.jpg')
11+
12+
d = cv2.QRCodeDetector()
13+
val, _, _ = d.detectAndDecode(cv2.imread("pic.jpg"))
14+
print("Decoded text is: ", val)
15+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /