Created
March 9, 2016 18:55
-
-
Save LukeB42/3c7afeb25461864fb4db to your computer and use it in GitHub Desktop.
This file contains 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
// gcc -c $(python2.7-config --cflags) simplepython.c | |
// gcc simplepython.o $(/usr/bin/python2.7-config --ldflags) -o simplepython | |
#include <Python.h> | |
int main(int argc, char *argv[]) | |
{ | |
Py_SetProgramName(argv[0]); /* optional but recommended */ | |
Py_Initialize(); | |
PyRun_SimpleString("from time import time,ctime\n" | |
"print 'Today is',ctime(time())\n"); | |
Py_Finalize(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment