From a5b421fdd3540f945794b5f20d4a71421fc836f9 Mon Sep 17 00:00:00 2001 From: Ananya Gupta <145869907+ananyag309@users.noreply.github.com> Date: Thu, 3 Oct 2024 11:54:50 +0530 Subject: [PATCH] Add files via upload --- Beginner_Projects/QR Generator/README.md | 33 +++++++++++++++++++ .../QR Generator/generate_qrcode.py | 18 ++++++++++ 2 files changed, 51 insertions(+) create mode 100644 Beginner_Projects/QR Generator/README.md create mode 100644 Beginner_Projects/QR Generator/generate_qrcode.py diff --git a/Beginner_Projects/QR Generator/README.md b/Beginner_Projects/QR Generator/README.md new file mode 100644 index 0000000000..0171447ddd --- /dev/null +++ b/Beginner_Projects/QR Generator/README.md @@ -0,0 +1,33 @@ +## **QR Code Generator** + +### ๐ŸŽฏ **Goal** + +This script take a link of any URL and generate a QR code corresponding to it. + +Library Used: +[qrcode](https://github.com/lincolnloop/python-qrcode) + + +### ๐Ÿงพ **Description** + +The QR Code Generator script creates a QR code based on the input URL. Users can customize the size, error correction level, and color of the QR code. The generated QR code is saved as an image file and can be used for scanning or sharing the URL. + +### ๐Ÿš€ **Models Implemented** + +- Provide your desired URL in the script +- Execute `python3 generate_qrcode.py` + + +### ๐Ÿ“ข **Conclusion** + +`This script efficiently generates a customized QR code for any input URL, allowing for color customization and easy storage as an image.` + +### โœ’๏ธ **Your Signature** + + +`Ananya Gupta` +[GitHub Profile](https://github.com/ananyag309) + + + + \ No newline at end of file diff --git a/Beginner_Projects/QR Generator/generate_qrcode.py b/Beginner_Projects/QR Generator/generate_qrcode.py new file mode 100644 index 0000000000..6574791432 --- /dev/null +++ b/Beginner_Projects/QR Generator/generate_qrcode.py @@ -0,0 +1,18 @@ +import qrcode + +input_URL = "https://www.google.com/" + +qr = qrcode.QRCode( + version=1, + error_correction=qrcode.constants.ERROR_CORRECT_L, + box_size=15, + border=4, +) + +qr.add_data(input_URL) +qr.make(fit=True) + +img = qr.make_image(fill_color="red", back_color="white") +img.save("url_qrcode.png") + +print(qr.data_list)