推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
bestehen
V2EX  ›  Python

Python 调用 nodejs 取结果 用下面这种方法如何写?

  •  
  •   bestehen · Aug 20, 2018 · 3148 views
    This topic created in 2963 days ago, the information mentioned may be changed or developed.

    python 用 os.popen 调用 node 然后取结果

    3 replies  •  2018-08-22 09:49:48 +08:00
    huaerxiela
        1
    huaerxiela  
       Aug 20, 2018
    用 execjs 啊
    bestehen
        2
    bestehen  
    OP
       Aug 22, 2018
    @huaerxiela 我说调用 nodejs 不是 js
    huaerxiela
        3
    huaerxiela  
       Aug 22, 2018
    @bestehen 直接用 execjs 执行 node 代码得出返回值便是,为什么要再去用 os 去调 node 命令行? 要是涉及到浏览器执行 js 就 pyppeteer 或者进一步封装的 requests_html 去执行 js 代码,也不需要用到你说的那种,如果我没理解错你的问题的话,感觉你现在选取的技术策略有那么一点问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4654 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 08:49 · PVG 16:49 · LAX 01:49 · JFK 04:49
    ♥ Do have faith in what you're doing.