Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding:utf-8
- from MyQR import myqr
- from appJar import gui
- import os
- def create_qrcode():
- text = app.getEntry("Texto").encode("utf-8").decode("ascii", "ignore")
- picture_path = app.getEntry("f1")
- if not picture_path:
- colorf = False
- else:
- colorf = True
- version, level, qr_name = myqr.run(text,
- version=1,
- level='H',
- picture=picture_path,
- colorized=colorf,
- save_name="qr_pronto.gif",
- save_dir=os.getcwd())
- app.setImage("qrcode", "qr_pronto.gif")
- os.remove("qr_pronto.gif")
- app = gui()
- app.title = "Gerar QR Code"
- app.addEntry("Texto")
- app.addFileEntry("f1")
- app.addImage("qrcode", "none.png")
- app.addButton("Gerar", create_qrcode)
- app.go()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement