10 std::cout <<
"ERROR: insufficient command arguments" << std::endl;
15 std::string fullversion = Py_GetVersion();
16 std::string version( fullversion, 0, fullversion.find_first_of(
' '));
17 std::string vers(version, 0, version.find_first_of(
'.',version.find_first_of(
'.')+1));
18 std::cout <<
"Python version: [" << vers <<
"]" << std::endl;
21 PyRun_SimpleString(
"print dir()" );
23 std::cout <<
"Running now: " << argv[1] << std::endl;
24 std::ifstream
file(argv[1]);
25 std::stringstream str;
28 while( file.get(ch) ) str.put(ch);
29 PyRun_SimpleString( const_cast<char*>(str.str().c_str()) );
33 std::cout <<
"ERROR: could not open file " << argv[1] << std::endl;
35 std::cout <<
"Exiting now " << std::endl;