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)
# Importing library
import qrcode
# Data to be encoded
data = 'www.google.com'
# Encoding data using make() function
img = qrcode.make(data)
# Saving as an image file
img.save('MyQRCode1.png')
pip install qrcode[pil]
import qrcode
img=qrcode.make("message")
img.save("pic.png") //save the qrcode photo as pic.png
import qrcode
img = qrcode.make('Some data here')
type(img) # qrcode.image.pil.PilImage
img.save("some_file.png")
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()