A Python-based QR code generator that creates shopping bill QR codes with customer details, itemized billing, and total cost. This project demonstrates how to work with libraries like qrcode and PIL to generate and save QR codes dynamically.
- Accepts customer details, bill ID, and itemized shopping details.
- Calculates the total bill amount automatically.
- Generates a QR code containing all bill details.
- Saves the QR code as an image file (
shopping_qr_code.png).
- Python 3.6 or higher
- Libraries:
qrcodePillow(PIL)
- Clone the repository:
git clone https://github.com/masimkhan-dev/qr-code-generator.git cd qr-code-generator - Install the required libraries:
pip install qrcode pillow
- Run the script:
python main.py
- Enter customer details, bill ID, and itemized shopping information.
- The script will calculate the total bill and generate a QR code.
- The QR code will be saved in the current directory as
shopping_qr_code.png.
Enter customer name: John Doe
Enter bill ID: 12345
Enter item name (or type 'done' to finish): Apple
Enter price for Apple: 2.5
Enter quantity for Apple: 4
Enter item name (or type 'done' to finish): Milk
Enter price for Milk: 1.8
Enter quantity for Milk: 2
Enter item name (or type 'done' to finish): done
- A QR code file
shopping_qr_code.pngcontaining:Customer Name: John Doe Bill ID: 12345 Shopping Bill: Apple (x4): $10.00 Milk (x2): $3.60 Total: $13.60
- Add an option to display the QR code directly after generation.
- Integrate the feature to email or share the QR code.
- Implement a GUI for better user interaction.
Contributions are welcome! Please fork the repository and submit a pull request.