Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to display qr code in python

import os
import qrcode

img = qrcode.make("https://Your-URL-here")

img.save("qr.png", "PNG")

os.system("display qr.png")
Comment

python library to make qr codes

pip install qrcode[pil]
Comment

create qr code in python

# 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)
Comment

Python Script to Read QR Code

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())
Comment

Python Script to Generator QR Code

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()
Comment

PREVIOUS NEXT
Code Example
Python :: beautifulsoup docs 
Python :: float in python 
Python :: any and all in python3 
Python :: how to create models in django 
Python :: how to store object in file python 
Python :: python default dictionary 
Python :: python if syntax 
Python :: django email verification 
Python :: how to learn regex pyton 
Python :: separate digits with comma 
Python :: do i need do some set when i use GPU to train tensorflow model 
Python :: python input().strip() 
Python :: check if a number is integer or decimal in python 
Python :: odd number sum in python 
Python :: use chrome console in selenium 
Python :: add Elements to Python list Using insert() method 
Python :: how to generate two random numbers in python 
Python :: sort array numpy 
Python :: get pattern from string python 
Python :: how to access dictionary inside an array python 
Python :: pandas splitting the data based on the day type 
Python :: bitcoin with python 
Python :: [1,2,3,4,5] 
Python :: python3 vowels and consonants filter 
Python :: godot variablen einen wert hinzufügen 
Python :: load text file line in listbox python tkinter site:stackoverflow.com 
Python :: max(X_train, key=len).split() 
Python :: python force realod 
Shell :: ubuntu audio restart 
Shell :: how to uninstall react native cli globally 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =