CodeSolved

Solved Programming Questions & Exercises

Making QR Code

Practice Easy 1778/ Download 225 Views

Write a program that receives a URL or text and converts it to a QR Code and saves with a PNG extension.

3 Answers

import qrcode
import os

def click():
    url = 'https://www.accuweather.com/en/ir/tehran/210841/weather-forecast/210841'
    image = qrcode.make(url)
    image.save("qrcode.png")
    os.system('qrcode.png')
click()

Sumy.amiri Download Python

This is the second method Sumy.amiri



import qrcode
import os

def click(text):
    image = qrcode.make(text)
    image.save("qrcode.png")
    os.system("qrcode.png")
print(click(text=str(input("enter your text:"))))


Sumy.amiri Download Python

The first method Sumy.amiri


OS module to save file as PNG and QRCODE module to build kwarcod.
import qrcode as qr 
import os
data= input(f'Entger the message to be encoded :')
img=qr.make(data)
img.save('myqr.png')
os. system('myqr.png')

Submit answer

Submitting answers is currently unavailable.

×
×
Close