import execjs def encrypt(c1,c2): with open('encrypt.js', encoding='utf-8') as f: jscode = f.read() txt = execjs.compile(jscode).call('get_psw', c1, c2) # get_psw为js中加密函数,c1、c2为传入参数 print(txt) return txt