推荐学习书目
› 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
michaelym
V2EX  ›  Python

如何用 Python 做出可以在前台显示实时计算、运行的结果,例如 IPython NoteBook 这种的。

  •  
  •   michaelym · Jan 16, 2017 · 3513 views
    This topic created in 3539 days ago, the information mentioned may be changed or developed.
    再举个例子,比如用户在前台点击按钮,后台访问 web service 去获取一些数据,然后再以绘图或者其他形式返回到前台给用户。
    5 replies  •  2017-01-17 23:22:45 +08:00
    NaVient
        1
    NaVient  
       Jan 16, 2017
    用 JS+python 很容易完成啊, ajax 请求数据
    michaelym
        2
    michaelym  
    OP
       Jan 16, 2017
    @NaVient 那后台的部分就是直接在 controller 里面调用另外一个 function 去访问外部 service 获得数据么,这样就是觉得时间上面会有一定损耗,还有什么其他好方法么?
    Fen2g
        3
    Fen2g  
       Jan 17, 2017
    @michaelym 可以使用 websocket 来实时计算,结果啊
    congeec
        4
    congeec  
       Jan 17, 2017 via iPhone
    都提到 notebook 了,看 Jupyter 源码吧, matplotlib 那块儿就是用 tornado with websocket 实现的。代码量不大。
    michaelym
        5
    michaelym  
    OP
       Jan 17, 2017
    @Fen2g
    @congeec 前端是个好方法,但后台访问外部 service 这个无法控制,硬要做成同步请求的话是不是没有什么好方案。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2454 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 11:54 · PVG 19:54 · LAX 04:54 · JFK 07:54
    ♥ Do have faith in what you're doing.