Skip to content

Instantly share code, notes, and snippets.

View fjolublar's full-sized avatar

Indrit Fejza fjolublar

View GitHub Profile
@kylehounslow
kylehounslow / client.py
Last active April 23, 2024 10:58
Send and receive images using Flask, Numpy and OpenCV
from __future__ import print_function
import requests
import json
import cv2
addr = 'http://localhost:5000'
test_url = addr + '/api/test'
# prepare headers for http request
content_type = 'image/jpeg'
@vpetro
vpetro / gist:1174019
Created August 26, 2011 18:10
Return multiple items from a mocked function with Python's mock.
import mock
def returnList(items):
def func():
for item in items:
yield item
yield mock.DEFAULT
generator = func()