Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python script from c++

#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
"
                     "print 'Today is',ctime(time())
");
  Py_Finalize();
  return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Python #script
ADD COMMENT
Topic
Name
2+4 =