Created
June 7, 2014 16:22
-
-
Save rguillebert/942712f51a31c7155089 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cffi | |
ffi = cffi.FFI() | |
ffi.cdef(""" | |
void Py_Initialize(); | |
int PyRun_SimpleString(const char *command); | |
void Py_Finalize(); | |
""") | |
cpython = ffi.dlopen("python2.7") | |
cpython.Py_Initialize() | |
cpython.PyRun_SimpleString("print 'Hello World'") | |
cpython.Py_Finalize() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment