how can I generate a single QR code for multiple links by using python?

Viewed 817

I am new to programming. I am trying to generate a QR code by using python where I can access multiple sites using a single QRcode.

2 Answers

QRCodes have a standard for one URL at a time and cannot simultaneously redirect to two websites. Despite this, services such as the following can help create a “landing page” where there is multiple link options. The QRCode will send the user to the landing page, then they have the freedom to select.

https://linktr.ee/

https://linkmix.co/en/

Implementing the Python QR Generation:

import qrcode

data = "https://hub_url"

qr = qrcode.QRCode(
        version=1,
        box_size=10,
        border=5)
qr.add_data(data)
qr.make(fit=True)
img = qr.make_image(fill='black', back_color='white')
img.save('code.png')

You Can Use This Code For General Purpose Use !!

#pip install pyqrcode
#pip install pypng
import pyqrcode
import png
from pyqrcode import QRCode
write = '''Link 1 : www.google.com
Link 2 : www.youtube.com'''
url = pyqrcode.create(write)
url.png('qr.png',scale = 5)#Image Name and image size
Related