Making QR Code
Write a program that receives a URL or text and converts it to a QR Code and saves with a PNG extension.
Write a program that receives a URL or text and converts it to a QR Code and saves with a PNG extension.
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()
This is the second method
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:"))))
The first method
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')
Submitting answers is currently unavailable.
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.