A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
Python-tesseract, i.e. pytesseract, is a Python wrapper around Google's Tesseract, an optical-character recognition program.
Here's a basic snippet:
from PIL import Image
import pytesseract
fname = './nytimes.com.201506231100.jpg'
img = Image.open(fname)
print(pytesseract.image_to_string(img)))
Notes for a presentation by Amelia Bellamy-Royds
SVG Summit, 15 February 2017
I've set up a CodePen as a scratchpad for the live-coding bits. Don't expect anything there to stay there long; fork the pen if you want to save the code & look at it later.
#!/usr/bin/env python3 | |
# vim: set fileencoding=utf-8 | |
for num_claps in range(2, 5): | |
globals()[num_claps * 'clap'] = (lambda num_claps: | |
(lambda: print(num_claps * '👏')) | |
)(num_claps) | |
clapclap() | |
clapclapclap() |