We can easily generate QR codes with python using pyqrcode module. It takes a string as input and generate QR code is expected format, having the string we gave as input. pyqrcode module follows standards of QR code.
Here is an implemetation of it.
Let's start by installing the pyqrcode module.
pip install pyqrcode
Here is sample code to generate QR code with www.hackersfriend.com as information in it.
# Import QRCode from pyqrcode import pyqrcode from pyqrcode import QRCode # String which represent the QR code s = "www.hackersfriend.com" # Generate QR code url = pyqrcode.create(s) # Create and save the png file naming "hackersfriend.svg" url.svg("hackersfriend.svg", scale = 8)
Here is what is generates: