-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqrCodeGenerator.py
More file actions
20 lines (17 loc) · 952 Bytes
/
Copy pathqrCodeGenerator.py
File metadata and controls
20 lines (17 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import qrcode
text = input("Enter text or URL: ")
img = qrcode.make(text)
img.save("qrcode.png")
print("QR code generated successfully!")
# pip install qrcode[pil]--> To Run above program, you need to install this libraries
# qrcode.make(text) generates a QR code from the given input (text or URL).
# img.save("qrcode.png") saves the QR code as an image file.
# This approach is simple and beginner-friendly, perfect for quick QR code generation.
import segno
qr = segno.make('https://github.com/Karan114-k')
qr.save("QrCode.png",scale=10,dark='black', light='white')
# pip install segno --> To Run above program, you need to install this libraries
# segno.make() creates a QR code with more customization options.
# scale=10 controls the size of the QR code.
# dark='black' and light='white' define the foreground and background colors.
# Segno supports advanced features like micro QR codes, error correction levels, and multiple output formats.