Skip to content

Instantly share code, notes, and snippets.

View michael-iuzzolino's full-sized avatar

Michael Iuzzolino michael-iuzzolino

View GitHub Profile
@michael-iuzzolino
michael-iuzzolino / hello-rnn.ipynb
Last active April 27, 2019 21:43
Hello RNN.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@michael-iuzzolino
michael-iuzzolino / Makefile
Created March 10, 2019 02:49
Makefile for ctypes example
clib.so: clib.o
gcc -shared -o clib.so clib.o
@michael-iuzzolino
michael-iuzzolino / clib.py
Last active March 10, 2019 03:14
clib python script for ctypes example
import ctypes
# A. Create library
C_library = ctypes.CDLL("clib.so")
# B. Specify function signatures
hello_fxn = C_library.say_hello
hello_fxn.argtypes = [ctypes.c_int]
# C. Invoke function
@michael-iuzzolino
michael-iuzzolino / clib.c
Last active March 10, 2019 03:25
Basic C Library for ctypes example
#include <stdio.h>
void say_hello(int times)
{
for (int i = 0; i < times; ++i)
{
printf("%d. Hello, Python. I am C!\n", i+1);
}
}