#include "Python.h"
#include <iostream>
#include <string>
#include <fstream>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 7 of file main.cpp.
9 std::cout <<
"ERROR: insufficient command arguments" << std::endl;
14 std::string fullversion = Py_GetVersion();
15 std::string version( fullversion, 0, fullversion.find_first_of(
' '));
16 std::string vers(version, 0, version.find_first_of(
'.',version.find_first_of(
'.')+1));
17 std::cout <<
"Python version: [" << vers <<
"]" << std::endl;
20 PyRun_SimpleString(
"print dir()" );
22 std::cout <<
"Running now: " <<
argv[1] << std::endl;
27 buffer.reserve(
file.tellg());
28 file.seekg(0, std::ios::beg);
29 buffer.assign((std::istreambuf_iterator<char>{
file}),
30 std::istreambuf_iterator<char>{});
32 PyRun_SimpleString( buffer.c_str() );
34 std::cout <<
"ERROR: could not open file " <<
argv[1] << std::endl;
36 std::cout <<
"Exiting now " << std::endl;
GAUDI_API long argc()
Number of arguments passed to the commandline (==numCmdLineArgs()); just to match argv call...
auto end(reverse_wrapper< T > &w)