This is a simple Python script to generate QR codes. The script takes a URL or any text, encodes it into a QR code, and saves the generated image as a .png file.
- Customizable: Set the size, error correction level, and border of the QR code.
- Simple to Use: Just specify the link or text you want to encode, and the script will handle the rest.
- Lightweight: Only requires a few dependencies.
- Python 3.x
- Required Python libraries listed in
requirements.txt
-
Clone the repository:
git clone https://github.com/your-username/qr-code-generator.git cd qr-code-generator -
Install the required Python libraries:
- Windows:
pip install -r requirements.txt - Linux:
Note: pip3 might not be installed by-default in some of the Linux distros. Please install it before installing the dependencies To install pip3 type:
pip3 install -r requirements.txt
sudo apt-get install python3-pip # If you are in Debian-based disto sudo pacman -S python3-pip # If you are in Arch-based distro sudo dnf install python3-pip # If you are in Fedora sudo yum install python3-pip # If you are in CentOS/RHEL
-
Open the
qr_code_generator.pyfile. -
Replace the
linkvariable with the URL or text you want to encode:link = "https://your-link-here"
-
Run the script:
python qr_code_generator.py
-
The generated QR code will be saved as
qrcode.pngin the current directory.