I wanted to use QR code to mention all my sources for a poster however I could not find any QR code generator which would never expire and would allow me to customise however I want. Specifically, I wanted the QR code to be transparent which no website seems to have.
Code teardown
So the actual code goes like:
- a function called
generate_qr_code
which specifies all the properties of the qr code and the data which the qr code will hold. I just added the option for a URL as that was what I wanted and thats much more flexiable as I can update it if the link is from Google Drive (which it will be).
|
|
- Then there is a
main
function takes the users’ input i.e. the URL and the destination file. There is some logic as well to check if the URL works and if it doesn’t then the script mentions that to the user.
|
|
thats pretty much it. You can contribute to this script and add other features or implement the same features using a better method. You can use the script as well to generate QR codes by cloning the code from GitHub: https://github.com/mansoorbarri/qr-code/
Happy coding!
-MB