Created
December 22, 2016 16:21
-
-
Save tovask/6c3362e350d25cfc637cd4627f967ae9 to your computer and use it in GitHub Desktop.
This file contains 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
""" | |
Decode all QR-code images in a directory. | |
Dependencies: | |
sudo pip install pypng | |
sudo apt-get update | |
sudo apt-get install libzbar-dev | |
sudo pip install zbar | |
sudo pip install pillow | |
sudo pip install qrtools | |
""" | |
import qrtools | |
from os import listdir | |
from os.path import isfile, join | |
mypath = "encoded" | |
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] | |
#print len(onlyfiles) | |
#onlyfiles = onlyfiles[:10] | |
#print onlyfiles | |
qr = qrtools.QR() | |
for f in onlyfiles: | |
try: | |
qr.decode(join(mypath, f)) | |
print qr.data, f | |
except: | |
print "Exception at "+f+"\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment