qr.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Trity 作者: toxic-ig 项目源码 文件源码
def gen_qrcode():
    url = raw_input(''+T+'' + color.UNDERLINE + 'Website or text>' + color.END)
    print ""+C+"Enter the name of the output file without the extension"
    name = raw_input(''+T+'' + color.UNDERLINE + 'Output>' + color.END)
    qr = qrcode.QRCode(5, error_correction=qrcode.constants.ERROR_CORRECT_L)
    qr.add_data(url)
    qr.make()
    im = qr.make_image()
    time.sleep(1)

    qr_img_path = os.path.join(name + ".png")

    if os.path.isfile(qr_img_path):
        os.remove(qr_img_path)
    # save the image out
    im.save(qr_img_path, format='png')
    # print that its been successful
    print(""+G+"[!] " + color.UNDERLINE + "QRCode has been generated!" + color.END)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号