| 2 | #include "Interpreter.h" |
| 3 | |
| 4 | int main( int argc, char *argv[] ) |
| 5 | { |
| 6 | std::string commands[] = { |
| 7 | "from time import time,ctime\n", |
| 8 | "print('Today is',ctime(time()))\n" |
| 9 | }; |
| 10 | Interpreter::Initialize( ); |
| 11 | Interpreter* interpreter = new Interpreter; |
| 12 | for ( int i = 0; i < 2; ++i ) |
| 13 | { |
| 14 | int err; |
| 15 | std::string res = interpreter->interpret( commands[i], &err ); |
| 16 | std::cout << res; |
| 17 | } |
| 18 | delete interpreter; |
| 19 | |
| 20 | Interpreter::Finalize( ); |
| 21 | return 0; |
| 22 | } |