Stephen Wilde
Welcome to my blog here you can find things I have made or I am working on. I program in C/C++, Python, JS, Lua and more.

QRcode Generator Python

I use QR codes a lot for many diffrent projects and can’t really be bothered using an online genrerator so i made one a while ago and use it a lot so I wanted to share it with you. Feel free to try it out the source code is:

This project is now on GitHub
import qrcode

#Welcome message durr
welcome = "Welcome to this QR generator by"

#list for file extentions
ext = ["jpg", "png", "gif"]

#Step 1 Txt of QRcode
print("Enter your QRcode TXT")
qrcodeInput = input()

#Step 2 File Name
print("Enter the name of the image")
qrcodeFName = input()
#replaces all empty strings with _ for a reason! just sayin
qrcodeFName = qrcodeFName.replace(" ", "_")
img = qrcode.make(qrcodeInput)

#Step 3 File extension
print("Please enter a number to your file extension\n1 for jpg\n2 for png\n3 for gif" )
qrcodeFExt = input()
qrcodeFExt = int(qrcodeFExt)

if qrcodeFExt == 1: + "." + (ext[0]))
    print("Saved as " + qrcodeFName + "." + (ext[0]))

elif qrcodeFExt == 2: + "." + (ext[1]))
    print("Saved as " + qrcodeFName + "." + (ext[1]))

elif qrcodeFExt == 3: + "." + (ext[2]))
    print("Saved as " + qrcodeFName + "." + (ext[2]))

    print("can not save as file extension is not valid")

#step 4 its obvious

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *