//调用Python
import console;
console.log("必须在导入python库以前打开控制台,
python中的print函数才能支持控制台.")

import py3;

var pyCode = /**
def sign_request():
    from hashlib import sha1
    import hmac
    import binascii
    key = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"
    raw = "Hi There" # as specified by oauth
    hashed = hmac.new(key.encode("gbk"), raw.encode("gbk"), sha1)
    return binascii.b2a_base64(hashed.digest())[:-1].decode("gbk")
    
def permutations(items,r): 
    from itertools import permutations
    return list(permutations(items,r))
**/

//执行Python3 的代码
py3.exec( pyCode )

//调用python3 __main__ 模块下的函数
console.log( py3.main.sign_request() )

//从 py3.main 模块获取 Python 创建的函数 
var pyList = py3.main.permutations(
	{"a","b","c"},
	//aardio 数值默认转为 Python 浮点数, 可使用 py3.int() 生成 Python 整数
	py3.int(2) 
);
console.dump( pyList.parseValue() );


console.pause()