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

小白求救,html 中 Button 点击后想调用 python 脚本中的函数,怎么实现啊.

  •  
  •   alexinit · Nov 5, 2015 · 9790 views
    This topic created in 3988 days ago, the information mentioned may be changed or developed.
    如题.
    7 replies  •  2016-05-30 18:16:43 +08:00
    Ncer
        1
    Ncer  
       Nov 5, 2015
    QT 里有 addToJavaScriptWindowObject
    vileer
        2
    vileer  
       Nov 5, 2015   ❤️ 1
    给两条思路吧:
    1.webview 接口,就像 1 楼那样
    2.实现一个 tiny web server , python 本来就有个 SimpleHTTPServer 的模块,实现起来不是什么难事
    wkdhf233
        3
    wkdhf233  
       Nov 5, 2015
    http://www.brython.info/
    你在说这个么
    alexinit
        4
    alexinit  
    OP
       Nov 5, 2015
    huson
        5
    huson  
       Nov 5, 2015
    用 web.py 或者其他 flask 等微框架 直接把函数写里面 用 url 调用就行了啊。。
    alexinit
        6
    alexinit  
    OP
       May 30, 2016   ❤️ 1
    @huson 解决了,直接用 flask 写成借口调用就可以啦.之前太小白.
    alexinit
        7
    alexinit  
    OP
       May 30, 2016
    接口-->接口,打错字了.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2725 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 100ms · UTC 02:28 · PVG 10:28 · LAX 19:28 · JFK 22:28
    ♥ Do have faith in what you're doing.