Skip to content

Instantly share code, notes, and snippets.

@daddykotex
daddykotex / variable-python-decorators.py
Last active January 5, 2021 04:17
Use an existing python decorator with variable parameters
#
# pip install tenacity
# Usage:
# → py variable-python-decorators.py 4
# The given maximum attempt number is 4
# We want this function to be retried 5 times
# We want this function to be retried 5 times
# We want this function to be retried 5 times
# We want this function to be retried 5 times
# We want this function to be retried 5 times
@attilaolah
attilaolah / imgcmp.py
Created February 29, 2012 11:30
Fast image comparison with Python
import math
import Image
import Levenshtein
class BWImageCompare(object):
"""Compares two images (b/w)."""
_pixel = 255