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., '[Link] ").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 [Link]('.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 = [Link](data)
[Link](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 [Link] (17 kB)
WARNING: qrcode 8.1 does not provide the extra 'pillow'
Downloading [Link] (45 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.7/45.7 kB 1.6 MB/s eta [Link]
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., '[Link] [Link]
Save as (e.g., 'google_qr'): ojas
Added: [Link]
Text/URL (e.g., '[Link]
Generating QR codes...
✅ Saved: [Link]
All done! Check the files on the left <--
[Link] 1/2
4/22/25, 8:10 AM Library presentation - Colab
[Link] 2/2