//捕获标准输出
import console;
import py3;

var pyCode = /**
import sys
class CatchOutErr:
    def __init__(self):
        self.value = ''
    def write(self, txt):
        self.value += txt
catchOutErr = CatchOutErr()
sys.stdout = catchOutErr
sys.stderr = catchOutErr
**/
py3.exec( pyCode )

//执行Python代码
py3.exec("print(1+123)");

//获取Python中的属性值
var pyStdoutStr = tostring(  py3.main.catchOutErr.value );
console.log( pyStdoutStr )

console.pause()

