Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / exporting_modules_functions_from_python_init.md
Last active July 15, 2024 09:44
Exporting Modules and Functions from Python `__init__.py` #python

Exporting Modules and Functions from Python __init__.py

Any directory with __init__.py is considered a package in Python.

Any python files inside a package is considered a module.

Modules contain functions and other bindings that is always exported.

If you are outside the package, and you want to import a module from a package:

@lnlonSA
lnlonSA / skewing.py
Created November 16, 2016 17:18
skewing detection and correction using python with opencv
import numpy as np
import math
import cv2
def compute_skew(file_name):
#load in grayscale:
src = cv2.imread(file_name,0)
height, width = src.shape[0:2]