394
Qc
qr-code-maker / files
qr-code-maker / qr_maker.py
995 bytes
1import qrcode 2import qrcode.image.svg 3 4def main(): 5 # # define a method to choose which factory metho to use 6 # # possible values 'basic' 'fragment' 'path' 7 # method = "basic" 8 9 # data = "Some text that you want to store in the qrcode" 10 11 # if method == 'basic': 12 # # Simple factory, just a set of rects. 13 # factory = qrcode.image.svg.SvgImage 14 # elif method == 'fragment': 15 # # Fragment factory (also just a set of rects) 16 # factory = qrcode.image.svg.SvgFragmentImage 17 # elif method == 'path': 18 # # Combined path factory, fixes white space that may occur when zooming 19 # factory = qrcode.image.svg.SvgPathImage 20 21 # # Set data to qrcode 22 # img = qrcode.make(data, image_factory = factory) 23 24 # # Save svg file somewhere 25 # img.save("qrcode.svg") 26 27 code = qrcode.make("The matrix is watching you, Rodas...", image_factory=qrcode.image.svg.SvgPathImage) 28 code.save('code.svg') 29 30 31 32if __name__ == '__main__': 33 main()