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

用 python 实现类似 node-webkit 的功能?

  •  
  •   pc10201 · Oct 26, 2014 · 5355 views
    This topic created in 4377 days ago, the information mentioned may be changed or developed.
    最近要用python写一个桌面程序

    Tkinter太丑(也没有啥顺手的设计器),pyqt太庞大
    会一点html,bootstrap和flask之类的
    我在想,应该可以用flask来写,然后打包成exe,调用浏览器访问就可以了,但不知道如何隐藏地址栏

    网上也有类似的框架或实现,比如
    https://code.google.com/p/cefpython/
    http://pyjs.org/
    Pyjamas
    Titanium

    有没有高手分享一下经验?
    7 replies  •  2014-11-03 16:25:32 +08:00
    magicdawn
        1
    magicdawn  
       Oct 26, 2014
    CEF就是干这个的吧...不知道对不对

    https://code.google.com/p/cefpython/
    magicdawn
        2
    magicdawn  
       Oct 26, 2014
    CEF你自己也说了...可以试试...
    14
        3
    14  
       Oct 26, 2014 via Android
    哇 干过这个 Flask打包成exe运行一个服务器,然后用 node-webkit就行了
    最大的问题是Flask内置的调试服务器性能太差,分分钟挂掉。。。
    14
        4
    14  
       Oct 26, 2014 via Android
    node-webkit 的index.html写一行
    <meta http-equiv="refresh" url=http://127.0.0.1:8000" />
    就行了,不过这样nw启动的时候会快速闪一下,其实首页可以用本地文件
    elvis_w
        5
    elvis_w  
       Oct 26, 2014
    @14
    同样觉得flask调试服务器垃圾,gevent来一发如何?

    from gevent.wsgi import WSGIServer
    from yourapplication import app

    http_server = WSGIServer(('', 5000), app)
    http_server.serve_forever()
    yangzh
        6
    yangzh  
       Nov 2, 2014
    pyqt 或者 pyside 写完之后用 pyinstaller 打包呗,打包只会把需要的模块包含进去不会全部都包含的。类似 node-webkit 的也是一样的大体积。
    Owenjia
        7
    Owenjia  
       Nov 3, 2014 via Android
    @yangzh 前段时间密码学作业要求写 des,用 PyQt4 写了个,拖到 win 下打完包好像有 11 M左右的样子~
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   992 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 18:49 · PVG 02:49 · LAX 11:49 · JFK 14:49
    ♥ Do have faith in what you're doing.