摘要: 一、安装pyzbar:pip install pyzbar 二、示例代码如下: import os import requests from io import BytesIO from pyzbar import pyzbar from PIL import Image,ImageEnhance 阅读全文
posted @ 2020-10-30 14:08 小李探花0520 阅读(656) 评论(0) 推荐(0) 编辑
摘要: 代码直接复制运行即可,需要先安装opencv和pyzbar的包 # coding:utf8 import cv2 import pyzbar.pyzbar as pyzbar def decodeDisplay(image): barcodes = pyzbar.decode(image) for 阅读全文
posted @ 2020-10-30 13:59 小李探花0520 阅读(1049) 评论(0) 推荐(0) 编辑
摘要: 内置函数——eval、exec、compile eval() 将字符串类型的代码执行并返回结果 print(eval('1+2+3+4')) exec()将自字符串类型的代码执行 print(exec("1+2+3+4")) exec("print('hello,world')") code = ' 阅读全文
posted @ 2020-10-30 10:44 小李探花0520 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 序列化模块 什么叫序列化——将原本的字典、列表等内容转换成一个字符串的过程就叫做序列化。 比如,我们在python代码中计算的一个数据需要给另外一段程序使用,那我们怎么给? 现在我们能想到的方法就是存在文件里,然后另一个python程序再从文件里读出来。 但是我们都知道,对于文件来说是没有字典这个概 阅读全文
posted @ 2020-10-30 09:04 小李探花0520 阅读(107) 评论(0) 推荐(0) 编辑