import subprocess
from functools import partial
subprocess.Popen = partial(subprocess.Popen, encoding="utf-8")
import execjs
使用python拿到node异步js的值
import subprocess
p = subprocess.check_output(['node', 'encrypt.js'])
print(p.decode())
# 2
p = subprocess.check_output(['node', '-e', js])
# js是字符串,在js 里面console.log() 结果就行了
真特么强,黑佬 yyds