Create a qrcode thanks to Python code

Do you want to create a qr code to easily visit a link without having to write the address? It is usefult to put it in a web page so that people can go visit the link with their phone without having to write anything, but usig a qr code reader app. The iphone has the qr code reader into the camera, so there’s no need to install anything.

To do this, first you have to install pyqrcode and pypng

This is the output image that will be generated by the code below.

pythonprogramming.altervista.org

The code





import pyqrcode
address = "https://pythonprogramming.altervista.org/"
url = pyqrcode.create(address)
# url.svg('uca-url.svg', scale=8)
# url.eps('uca-url.eps', scale=2)
url.png('uca-url.png', scale=8)
print(url.terminal(quiet_zone=1))

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.