I wanted to learn how to make QR codes, so that I could make one with my contact information.
Contact Information:
The first step is to put together a contact file. You can export contact information you already have to a .vcf file, or you can put together a text file with your information. A sample would look like this:
BEGIN:VCARD VERSION:2.1 N:Scout;Mark;;; FN:Mark Scout TEL;CELL:000-555-1234 EMAIL;HOME:user@example.com ORG:Lumon Industries TITLE:Macrodata Refiner URL:https://lumon.industries/home/ URL:www.linkedin.com/company/lum0n-industries END:VCARD
Save as a .vcf file.
Wikipedia has a list of VCF attributes.
QR Code:
There’s a Python library (qrcode) that will create our QR code our of our .vcf file.
pip install qrcode
We just have to run our VCF file through a Python call to get an image file (a PNG) with our QR code.
import qrcode
file1 = open('C:\\Temp\Contact.vcf')
data = file1.read()
img = qrcode.make(data)
file1.close()
img.save('C:\\Temp\Contact.png')
Having someone scan the QR code with their phone will create a contact with the information you entered in the VCF.