调用 node 执行 js,可指定编码,支持异步返回
Project description
介绍
调用 node 执行 js ,可指定编码格式
支持异步调用,只要你调用的函数会返回结果就会正常返回
安装
pip install -U gexecjs
示例
# run_js = RunJs(filepath='test.js')
run_js = RunJs(content='''
function getCookie(){
return arguments
}
''')
result = run_js.run('getCookie', 'Gk')
print(result)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gexecjs-0.0.5.tar.gz
(3.1 kB
view details)
File details
Details for the file gexecjs-0.0.5.tar.gz.
File metadata
- Download URL: gexecjs-0.0.5.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3275102e0a73a769c25a01261ae7f7a7b8816a2a64cb59e4f2b331d3989f2c91
|
|
| MD5 |
b7d5aaf1d3c66206d3fb60120dc4f96c
|
|
| BLAKE2b-256 |
570d9dbdb44fac08df02ea01dff74898a3d6fb4bdcd7a6a15ae8a6fc0687bea1
|