import os
import qrcode
img = qrcode.make("https://Your-URL-here")
img.save("qr.png", "PNG")
os.system("display qr.png")
pip install qrcode[pil]
# Import QRCode from pyqrcode
import pyqrcode
import png
from pyqrcode import QRCode
# String which represents the QR code
s = "www.codingforfree.com"
# Generate QR code
url = pyqrcode.create(s)
# Create and save the svg file naming "myqr.svg"
url.svg("myqr.svg", scale = 8)
# Create and save the png file naming "myqr.png"
url.png('myqr.png', scale = 6)
pip install qrcode[pil]
import qrcode
img = qrcode.make('Some data here')
type(img) # qrcode.image.pil.PilImage
img.save("some_file.png")
from pyzbar.pyzbar import decode
from PIL import Image
d = decode(Image.open("path-to-qr-code.png"))
# print(d)
print(d[0].data.decode())
import pyqrcode
import png
from PIL import Image
s = "https://python.plainenglish.io/" # url to open after scanning qr code
url = pyqrcode.create(s) # creating qr code
img = "python-in-plain-english.png" # name of image
url.png(img, scale=10) # saving image as png
im=Image.open(img) # opening image
im.show()