mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-01-26 04:02:25 +00:00
initial import of python-console
This commit is contained in:
22
3rdparty/python-console/test_python_interpreter.cpp
vendored
Normal file
22
3rdparty/python-console/test_python_interpreter.cpp
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <iostream>
|
||||
#include "Interpreter.h"
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
std::string commands[] = {
|
||||
"from time import time,ctime\n",
|
||||
"print 'Today is',ctime(time())\n"
|
||||
};
|
||||
Interpreter::Initialize( );
|
||||
Interpreter* interpreter = new Interpreter;
|
||||
for ( int i = 0; i < 2; ++i )
|
||||
{
|
||||
int err;
|
||||
std::string res = interpreter->interpret( commands[i], &err );
|
||||
std::cout << res;
|
||||
}
|
||||
delete interpreter;
|
||||
|
||||
Interpreter::Finalize( );
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user