Created
December 7, 2021 15:47
-
-
Save raghavmri/5ea63001c05292ab61f3595078706ac4 to your computer and use it in GitHub Desktop.
A simple QR generator using python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pyqrcode # pip install pyqrcode | |
| # pip install pypng | |
| # you need to install pypng if you want to convert the qr code to png | |
| import png | |
| # This creates a QR code for our youtube channel | |
| # Can be any text or URL | |
| QRCode = pyqrcode.create( | |
| 'https://www.youtube.com/channel/UC5GG_qSQ2OgROyc0fRo0KzQ') | |
| print(QRCode.text(quiet_zone=1)) # Prints the QR code as text | |
| print(QRCode.terminal(quiet_zone=1)) # Prints the QR code to the terminal | |
| QRCode.png_as_base64_str(scale=6) # Creates a PNG file as a base64 string | |
| QRCode.png('QRCode.png', scale=6) # Creates a PNG file | |
| QRCode.svg('QRCode.svg', scale=8) # Creates an SVG file | |
| QRCode.eps('QRCode.eps', scale=2) # Creates an EPS file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment