Last active
January 1, 2016 08:28
-
-
Save maluta/8118060 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/python | |
""" | |
This is a game idea [what about for Christmas night] using QR-code. | |
(1) First I've generated several codes (each one with a different value), | |
in my case I use money (values on Brazilian Real) and at the party | |
(2) We randomly assign one to each participant | |
(3) They need scan the code to get the prize | |
It's interesting because probably kids will know what to do before mostly adults, | |
so they will teach your relatives ans friends. This game can be more interesting if you | |
associate with a quiz (each qr-code enables an enigma to next step until the big prize). | |
The script below just generate the code for you: | |
$ python xmas-game.py | |
and it's easy to figure out what to change to personalize | |
Leave your computer and enjoy with your family =) | |
Happy Christmas | |
Tiago Maluta (@maluta) | |
""" | |
import qrcode # install ==> https://pypi.python.org/pypi/qrcode | |
qr = qrcode.QRCode( | |
version=1, | |
error_correction=qrcode.constants.ERROR_CORRECT_L, | |
box_size=10, | |
border=4, | |
) | |
values = ["50"] + ["20"] + ["10"] + ["5"] + ["2"] | |
for v in values: | |
qr.add_data('Happy Christmas, this worth US$%s,00' % v) | |
qr.make(fit=True) | |
img = qr.make_image() | |
img.save("%s.png" % v) | |
qr.clear() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment