-(void)testInvokeJavascript{
NSString *strScript = @"var factorial = function(n){ if(n<0)return; if(n==0) return 1; return n*factorial(n-1);}";
JSContext *jsContext = [[JSContext alloc]init];
[jsContext evaluateScript:strScript];
JSValue *function = jsContext[@"factorial"];
JSValue *result = [function callWithArguments:@[@5]];
NSLog(@"factorial(5) = %d", [result toInt32]);
}
-(void)testInvokePython{
NSString* fullpath2 = [[NSBundle mainBundle] pathForResource:@"py3" ofType:nil inDirectory:nil];
// Do any additional setup after loading the view.
NSString* fullpath = @"/Users/xuan/Desktop/TestPython/TestPython/pythonb7/Python/Resources";
wchar_t home[1024];
wcscpy(home, [self stingTowWchar_t:fullpath2]);
Py_SetPythonHome(home);
Py_Initialize();
//run simple python code
PyRun_SimpleString("print ('hello')");
}