python识别二维码方法2-使用库opencv-python
安装第三方库
pip3 install opencv-python
def scan_QR_opencv(): file_path = './file/data/screenshot.png' QR_image = cv2.imread(file_path) QR_detector = cv2.QRCodeDetector() data, bbox, straight_qrcode = QR_detector.detectAndDecode(QR_image) print(data)
对data进行post请求,取返回值即可获取到想要的结果

浙公网安备 33010602011771号