Skip to content

Instantly share code, notes, and snippets.

@souvikhaldar
Last active January 27, 2020 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save souvikhaldar/2664c020fb14ecac15c92bed35bca2ef to your computer and use it in GitHub Desktop.
Save souvikhaldar/2664c020fb14ecac15c92bed35bca2ef to your computer and use it in GitHub Desktop.
How to generate QR code of any text data in python3
# Importing the module pyqrcode
import pyqrcode
# data for the QR code
s = input("Enter the data to be put in the QR code: ")
# Generate QR code by the help of create function
url = pyqrcode.create(s)
# name of the geneated file
name = input("Enter name for the generated image file: ")
filename = name + ".svg"
url.svg(filename, scale = 8)
print("File saved as",filename)
@souvikhaldar
Copy link
Author

Need to install module pyqrcode first using pip. i.e pip3 install pyqrcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment