python_使用qrcode生成二维码
2024-08-23 09:01:07
1.功能
使用qrcode生成二维码
2.代码
#生成二维码:
import qrcode #根据url生成二维码
def qrcodeWithUrl(url):
img = qrcode.make(url)
savePath = "1.png"
img.save(savePath) #根据输入的文字生成二维码
def qrcodeWithText(text):
img = qrcode.make(text)
savePath = "2.png"
img.save(savePath) #输入一句话
content = input("请输入一名话:")
if "http" in content:
qrcodeWithUrl(content)
else:
qrcodeWithText(content) print("二维码已生成完毕,请查看!")
最新文章
- SPSS课程学习思路及流程
- TSQL Merge On子句和When not matched 语义理解
- iOS下载使用系统字体
- Spark源码系列(八)Spark Streaming实例分析
- Spring3+hibernate4框架整合
- 《转载》常用算法经典代码(C++版)
- 对Golang有兴趣的朋友,推荐一款go语言Web框架-dotweb
- new/delete 与 malloc/free的区别
- 迈向angularjs2系列(4):脏值检测机制
- node,cnpm安装和配置
- BZOJ_1878_[SDOI2009]HH的项链_莫队
- 如何将一段文本编译成C#内存程序的过程
- Linux系统开发之路-中
- python requests 上传文件
- anaconda+pycharm的安装和应用
- 【vue】混合模式
- Python排序算法之插入排序
- hdu4675 GCD of Sequence 莫比乌斯+组合数学
- Linux 增加对外开放的端口
- thingsboard在windows下安装和使用