Create QR Codes using the qrcode Python library
-
Clone this repository
git clone https://github.com/1homas/QR_Codes.git
-
Create your Python environment
pip install pipenv # Python virtual environment manager pipenv install --python 3.9 # Python 3.9+ is currently recommended pipenv install pillow # Python Imaging Library pipenv install qrcode # QR Code library pipenv shell # launch the environment
-
Generate a Text QR code for a URL :
# PNG qr "https://github.com/1homas/QR_Codes" > QR_Code.png # SVG qr --factory=svg "https://github.com/1homas/QR_Codes" > QR_Code.svg # ASCII Characters qr --ascii "https://github.com/1homas/QR_Codes" > QR_Code.txt
-
Preview the images in your OS or a browser and
cat
theQR_Code.txt
file in a terminal with a monospaced font to view it properly:
cat QR_Code.txt
█▀▀▀▀▀█ ▀ ▄█▄▄▀██▀▄ █▀▀▀▀▀█
█ ███ █ ▄▄▀██▄▄▀▀▄▀▀ █ ███ █
█ ▀▀▀ █ ▄▄▄ ▀██ ▀ ▀▄▄ █ ▀▀▀ █
▀▀▀▀▀▀▀ ▀▄█▄█ █ ▀▄█ ▀ ▀▀▀▀▀▀▀
▀ ▄█▄█▀▄██▄ ▀ ▄█▀▄▄▀▄▀▄▀ ▄ ▄
█▀█▀ █▀▀ ▄██▄ ▄ ▀▀██▄▀ █▀██
█ █▀▄█▀█▄ ▄ █ ▀▀▄ █▀ ▀ ▀▀
▀▀ ▀ ▄▀▄▄ █▀▄▄▄▄▄▄▄ █▄█▀▀█▀█▀
▀ █▀▄▀▄█▀██▀▀▀ ▄ ▄ █▄▄█ ▄ ▀▄
▀ ██▄ ▀▀▄▄▀▀▄█ ▄▀▄█ ▄█ ██ ██
▀ ▀▀ ▀ █▄▄▄▀▄▀ ██▄██▀▀▀█ █▄▄
█▀▀▀▀▀█ ▄█ ▄ █▀ █▀▀ █ ▀ █▄▄█▄
█ ███ █ ▄▄█▀▀▄█▀▀ ▄▄█▀███▄▄▄▀
█ ▀▀▀ █ ▀ ▀▀▀▀ ▄▄██▄ █▀▀▄▀
▀▀▀▀▀▀▀ ▀▀ ▀▀ ▀ ▀▀▀▀▀▀ ▀
-
Edit the
qr_urls.py
script with your document names and URLs -
Save an image named
logo.png
for the logo in PNG format -
Run the script:
qr_urls.py
-
Then view the generated image:
-
Edit the
qr_wifi.py
script with your SSID parameters -
Run the script and optionally redirect the HTML output to a file
qr_wifi.py qr_wifi.py > SSID.html
This repository is licensed under the MIT License.