diff --git a/qr.py b/qr.py index b097afbd..52428ad2 100644 --- a/qr.py +++ b/qr.py @@ -1,11 +1,15 @@ -import pyqrcode -from pyqrcode import QRCode - -# String which represent the QR code -s = "https://fueler.io/arjun_ms" - -# Generate QR code -url = pyqrcode.create(s) - -# Create and save the png file naming "myqr.png" -url.svg("myyoutube.svg", scale = 8) \ No newline at end of file +import qrcode +def generate_qrcode(txt): + qr=qrcode.QRCode( # type: ignore + version=1, + error_correction=qrcode.ERROR_CORRECT_L, + box_size=10, + border=4 + ) + qr.add_data(txt) + qr.make(fit=True) + img=qr.make_image(fill_color='black',back_color='white') + img.save('qrimg.png') + +url=input('Enter the url: ') +generate_qrcode(url)