You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
836 B
40 lines
836 B
|
11 years ago
|
/*
|
||
|
|
void theprogram()
|
||
|
|
{
|
||
|
|
std::string input;
|
||
|
|
std::cout << "Enter string to transform: ";
|
||
|
|
std::getline(std::cin, input);
|
||
|
|
//std::string inttransformed = CallPythonPlugIn(input);
|
||
|
|
std::cout << "The transformed string is: " << input << std::endl;
|
||
|
|
}
|
||
|
|
|
||
|
|
int test1()
|
||
|
|
{
|
||
|
|
try{
|
||
|
|
Py_Initialize();
|
||
|
|
object main_module = import("__main__");
|
||
|
|
object main_namespace = main_module.attr("__dict__");
|
||
|
|
object ignored = exec("result = 5 ** 2", main_namespace);
|
||
|
|
int five_squared = extract<int>(main_namespace["result"]);
|
||
|
|
|
||
|
|
printf("%d\n", five_squared);
|
||
|
|
|
||
|
|
return five_squared;
|
||
|
|
}
|
||
|
|
catch(error_already_set const&){
|
||
|
|
PyErr_Print();
|
||
|
|
}
|
||
|
|
|
||
|
|
return -1;
|
||
|
|
}
|
||
|
|
|
||
|
|
void test2(int theNum, int &test)
|
||
|
|
{
|
||
|
|
int seven = 7;
|
||
|
|
|
||
|
|
test = 7+ theNum;
|
||
|
|
|
||
|
|
std::cout << theNum << std::endl;
|
||
|
|
}
|
||
|
|
*/
|