Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions qr_code_generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import qrcode

def generate_google_drive_qr():
try:
#Paste your public Google Drive shareable link here
drive_link = input("Paste your Google Drive link here: ").strip()

if not drive_link:
print("Error: Link cannot be empty!")
return

#Initialize QR Code object (to control version and box size)
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_M,
box_size=10,
border=4,
)

#Add the Drive link to the QR data
qr.add_data(drive_link)
qr.make(fit=True)

#Generate the image
img = qr.make_image(fill_color="black", back_color="white")

#Set the file path and save (in the Current Working Directory)
file_path = "drive_qr_code.png"
img.save(file_path)

print(f"\nSuccess! QR Code has been saved to: {file_path}")

except Exception as e:
print(f"Technical error occurred: {e}")

if __name__ == "__main__":
generate_google_drive_qr()