Python

Python Basic

July 31, 2021
Python, Basic

Python Basic # Install macOS # Check the default version of Python on macOS # $ python --version Python 2.7.16 $ which python /usr/bin/python Install the latest version using Homebrew # brew update Update Homebrew itself brew install Install package $ brew update $ brew install python Add Python’s path # $ vi ~/.bash_profile export PATH="/usr/local/opt/python/libexec/bin:$PATH" $ source ~/.bash_profile Check that the latest version is available # $ python --version Python 3. ...

Python OCR

July 31, 2021
Python, OCR, Tesseract

Python OCR # Overview # How to get text from an image using Tesseract which is an OCR (Optical Character Recognition) engine and Python. Precondition # Version # macOS: Big Sur 11.4 Docker: 20.10.5, build 55c4c88 docker-compose: 1.29.0, build 07737305 Simple sample # Version # Debian GNU/Linux: 10 (buster) Python: 3.9.6 pyocr: 0.8 opencv-python: 4.5.3.56 Directory structure # python-ocr/ ├── README.md ├── img │ ├── .gitkeep │ └── sample.jpg ├── setup │ ├── Dockerfile │ └── docker-compose. ...