zoukankan      html  css  js  c++  java
  • Python 生成个性二维码

    通过调用MyQR接口来实现生成个人所需二维码,并可以设置二维码的大小、是否在现有图片的基础上生成、是否生成动态二维码。

    1.1 知识点

    • Python3基础
    • MyQR库

    1.2 下载MyQR

    pip3 install MyQR

    1.3 代码和对应的效果截图

    1.3.1 普通二维码

    from MyQR import myqr
    myqr.run('https://www.shiyanlou.com')
    

      

    1.3.2 带图片的艺术二维码

    黑白的

    from MyQR import myqr
    myqr.run(
        words='https://www.shiyanlou.com',
        picture='D:/Automation_Develop_Work/Python_Learning/Other/wm.jpg',
        save_dir='D:/Automation_Develop_Work/Python_Learning/Other',
        save_name='qrcode_two.jpg',
        )
    

    彩色的

    from MyQR import myqr
    myqr.run(
        words='https://www.shiyanlou.com',
        picture='D:/Automation_Develop_Work/Python_Learning/Other/wm.jpg',
        save_dir='D:/Automation_Develop_Work/Python_Learning/Other',
        save_name='qrcode_three.png',
        colorized=True,
        )
    

    1.3.3 动态二维码

    from MyQR import myqr
    myqr.run(
        words='https://www.shiyanlou.com',
        picture='D:/Automation_Develop_Work/Python_Learning/Other/wm2.gif',
        save_dir='D:/Automation_Develop_Work/Python_Learning/Other',
        save_name='qrcode_four.gif',
        colorized=True,
        )
    

  • 相关阅读:
    1144 The Missing Number (20分)
    1145 Hashing
    1146 Topological Order (25分)
    1147 Heaps (30分)
    1148 Werewolf
    1149 Dangerous Goods Packaging (25分)
    TypeReference
    Supervisor安装与配置()二
    谷粒商城ES调用(十九)
    Found interface org.elasticsearch.common.bytes.BytesReference, but class was expected
  • 原文地址:https://www.cnblogs.com/MasterMonkInTemple/p/11361933.html
Copyright © 2011-2022 走看看