0% found this document useful (0 votes)
5 views

Library presentation - Colab

The document provides a guide for using a bulk QR code generator in Python. It includes instructions for installing the necessary library, collecting user inputs for QR code data and filenames, and generating the QR codes. The process allows users to save multiple QR codes as PNG files based on their input.

Uploaded by

wankhade.ojjas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Library presentation - Colab

The document provides a guide for using a bulk QR code generator in Python. It includes instructions for installing the necessary library, collecting user inputs for QR code data and filenames, and generating the QR codes. The process allows users to save multiple QR codes as PNG files based on their input.

Uploaded by

wankhade.ojjas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

4/22/25, 8:10 AM Library presentation - Colab

LIBRARY PRESENTATION

# Install the library (run this once)


!pip install qrcode[pillow]

# Import the library


import qrcode

print(" **Bulk QR Code Generator** ")


print("Enter your data and filenames below. Press ENTER on 'Text/URL' to finish")

qr_data = []

# Step 1: Collect unlimited inputs


while True:
data = input("Text/URL (e.g., 'https://google.com'): ").strip()
if not data: # Exit loop if user presses ENTER without typing
break
filename = input("Save as (e.g., 'google_qr'): ").strip()

# Add .png if missing


if not filename.endswith('.png'):
filename += ".png"

qr_data.append( (data, filename) )


print(f"Added: {filename}\n")

# Step 2: Generate all QR codes


if qr_data:
print("\n Generating QR codes...")
for data, filename in qr_data:
try:
img = qrcode.make(data)
img.save(filename)
print(f"✅ Saved: {filename}")
except:
print(f" Failed: {filename} (invalid filename?)")
print("\nAll done! Check the files on the left <--")
else:
print("\nNo QR codes requested. Exiting.")

Collecting qrcode[pillow]
Downloading qrcode-8.1-py3-none-any.whl.metadata (17 kB)
WARNING: qrcode 8.1 does not provide the extra 'pillow'
Downloading qrcode-8.1-py3-none-any.whl (45 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.7/45.7 kB 1.6 MB/s eta 0:00:00
Installing collected packages: qrcode
Successfully installed qrcode-8.1
**Bulk QR Code Generator**
Enter your data and filenames below. Press ENTER on 'Text/URL' to finish
Text/URL (e.g., 'https://google.com'): ojas.com
Save as (e.g., 'google_qr'): ojas
Added: ojas.png

Text/URL (e.g., 'https://google.com'):

Generating QR codes...
✅ Saved: ojas.png

All done! Check the files on the left <--

https://colab.research.google.com/drive/1fDvnKE6O4ve1GGxAHzGXlMDdmvL69KcB?authuser=3#scrollTo=T8v_BmJrWya2&printMode=true 1/2
4/22/25, 8:10 AM Library presentation - Colab

https://colab.research.google.com/drive/1fDvnKE6O4ve1GGxAHzGXlMDdmvL69KcB?authuser=3#scrollTo=T8v_BmJrWya2&printMode=true 2/2

You might also like