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

Python 和 web 前端通讯如何简单实现,前台除使用 websocket 或者直接长连接还有啥别简单办法没?

  •  
  •   qile1 · Jun 2, 2018 · 3556 views
    This topic created in 2971 days ago, the information mentioned may be changed or developed.
    Supplement 1  ·  Jun 2, 2018
    现在是想实现网页自动打印功能,利用后台传来的连接地址自动把对应连接以 web 形式打印出来。

    lodop 有个调取 web 地址直接打印,我想 实时检测后台出来的网址直接 web 打印!
    6 replies    2018-06-03 23:18:59 +08:00
    gsw945
        1
    gsw945  
       Jun 2, 2018
    简单实现...难道你说的不是 Ajax ?
    WebSocket,个人觉得最重要的用途是可以实现服务器向浏览器推送消息。(个人这样用过:Flask-SocketIO + socket.io
    est
        2
    est  
       Jun 2, 2018
    server-side events

    方便实用浏览器都支持用过的都说好。不需要任何异步框架。
    qiayue
        3
    qiayue  
       Jun 2, 2018
    提问不描述场景和真实需求都是耍流氓
    qile1
        4
    qile1  
    OP
       Jun 2, 2018
    @qiayue 谢谢提醒,有这个需求,主要还是想讨论下实现方式,现在在测试 ajax 实现长连接查询
    GoLand
        5
    GoLand  
       Jun 3, 2018 via Android
    @qile1 Ajax 长连接是啥?轮询?
    qile1
        6
    qile1  
    OP
       Jun 3, 2018 via Android
    @GoLand 就是轮询,时间超时设置的大些
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   972 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 20:19 · PVG 04:19 · LAX 13:19 · JFK 16:19
    ♥ Do have faith in what you're doing.