Skip to content

Instantly share code, notes, and snippets.

@ddahan
Created January 2, 2017 16:01
Show Gist options
  • Save ddahan/c9ec4df39e54dae1d1b7709b4f6f7836 to your computer and use it in GitHub Desktop.
Save ddahan/c9ec4df39e54dae1d1b7709b4f6f7836 to your computer and use it in GitHub Desktop.
def data_to_qrcode(data):
''' Return a qrcode image from data '''
qrc = qrcode.QRCode(error_correction=qrcode.constants.ERROR_CORRECT_Q,
box_size=8,
border=0)
qrc.add_data(data)
qrc.make(fit=True)
img = qrc.make_image()
return img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment