Guest User

Untitled

a guest
May 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import sys
  2. from PIL import Image
  3. from pydmtx import DataMatrix
  4.  
  5. if __name__ == '__main__':
  6. dmtx_image = Image.open(sys.argv[1])
  7. (width, height) = dmtx_image.size
  8. dm_read = DataMatrix()
  9. dmtx_code = dm_read.decode (width, height, buffer(dmtx_image.tostring()))
  10. if dmtx_code is not None:
  11. print "Found Datamatrix code '%s' in %s" % (dmtx_code, sys.argv[1])
  12. else:
  13. print "No Datamatrix code found in %s" % (sys.argv[1])
Add Comment
Please, Sign In to add comment