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("二维码已生成完毕,请查看!")

最新文章

  1. SPSS课程学习思路及流程
  2. TSQL Merge On子句和When not matched 语义理解
  3. iOS下载使用系统字体
  4. Spark源码系列(八)Spark Streaming实例分析
  5. Spring3+hibernate4框架整合
  6. 《转载》常用算法经典代码(C++版)
  7. 对Golang有兴趣的朋友,推荐一款go语言Web框架-dotweb
  8. new/delete 与 malloc/free的区别
  9. 迈向angularjs2系列(4):脏值检测机制
  10. node,cnpm安装和配置
  11. BZOJ_1878_[SDOI2009]HH的项链_莫队
  12. 如何将一段文本编译成C#内存程序的过程
  13. Linux系统开发之路-中
  14. python requests 上传文件
  15. anaconda+pycharm的安装和应用
  16. 【vue】混合模式
  17. Python排序算法之插入排序
  18. hdu4675 GCD of Sequence 莫比乌斯+组合数学
  19. Linux 增加对外开放的端口
  20. thingsboard在windows下安装和使用

热门文章

  1. 【Codeforces 947B】 Producting Snow
  2. vs2008工程部署不成功,可能是远程文件路径出现问题
  3. SimpleDateFormat并发隐患及其解决
  4. E20180406-hm
  5. TensorFlow图像处理函数
  6. @ConfigurationProperties和@EnableConfigurationProperties配合使用
  7. FlashFXP Registration
  8. bzoj 5018 [Snoi2017]英雄联盟
  9. php 缩略图
  10. python关于文件的一些记录