Created
February 2, 2018 10:31
-
-
Save meehow/720a7d7f8e74cd6bc94596e86b63f421 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=utf-8 | |
import base64 | |
import cStringIO | |
import qrcode | |
import sys | |
if __name__ == "__main__": | |
buf = cStringIO.StringIO() | |
qrcode.make(sys.argv[1], error_correction=qrcode.ERROR_CORRECT_Q, border=1).save(buf) | |
print 'data:image/png;base64,' + base64.b64encode(buf.getvalue()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment