File: class/Workbook/Examples/Lecture16/main1.c
#include <Python.h>
main(argc, argv)
int argc;
char **argv;
{
/* This is the simplest embedding mode. */
/* Other API functions return results, */
/* accept namespace arguments, allow */
/* access to real Python objects, etc. */
/* Strings may be precompiled for speed. */
Py_Initialize(); /* init python */
PyRun_SimpleString("print 'Hello embedded world!'");
/* use C extension module above */
PyRun_SimpleString("from environ import *");
PyRun_SimpleString(
"for i in range(4):\n"
"\tprint i,\n"
"\tprint 'Hello, %s' % getenv('USER')\n\n" );
PyRun_SimpleString("print 'Bye embedded world!'");
}