V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
chuhades
V2EX  ›  Python

Py 的图形界面开发,哪个包好些?

  •  
  •   chuhades ·
    Q2h1Cg · 2013-05-27 14:35:42 +08:00 · 6340 次点击
    这是一个创建于 3986 天前的主题,其中的信息可能已经有所发展或是发生改变。
    py 用了一段时间了,但是一直都没做过图形界面,不知道哪个包好些?
    最好是可以可视化的~
    26 条回复    1970-01-01 08:00:00 +08:00
    RelativeLayout
        1
    RelativeLayout  
       2013-05-27 14:43:39 +08:00   ❤️ 2
    chon
        2
    chon  
       2013-05-27 14:49:01 +08:00   ❤️ 1
    没用py开发过图形界面,但是看很多人用PyQt
    likai
        3
    likai  
       2013-05-27 14:56:19 +08:00 via Android
    pyqt
    Golevka
        4
    Golevka  
       2013-05-27 15:13:27 +08:00
    只用过Tk的路过, 并表示Tk好难用
    davepkxxx
        5
    davepkxxx  
       2013-05-27 15:33:07 +08:00
    我一般都开发console程序,不过看到很多人推荐qt
    passluo
        6
    passluo  
       2013-05-27 15:40:41 +08:00
    WXwidgets ?
    thedevil5032
        7
    thedevil5032  
       2013-05-27 16:22:54 +08:00   ❤️ 1
    只用过 PyQt,觉得上手比较容易。
    编程大致过程:看例子,根据需求由 class 名选择 class,看 class 文档,写代码实验。
    界面写起来很方便。
    (我的 github 上有几个简单的应用,请随意参观,欢迎建议和问题)

    关于 PyQt 和 PySide 的比较: http://stackoverflow.com/questions/1297660/pyside-vs-pyqt

    ====
    class 文档:
    这个似乎上不去了, http://pyqt.sourceforge.net/Docs/PyQt4/classes.html
    两个的内容应该是一样的, http://qt-project.org/doc/qt-4.8/classes.html

    虽然是针对 C++ 写的文档,但无论是函数名,method 在 Python 下都是一样的。
    yaotian
        8
    yaotian  
       2013-05-27 16:25:28 +08:00
    @RelativeLayout 这个能被真正用到项目中吗?
    yangguang
        9
    yangguang  
       2013-05-27 16:49:21 +08:00
    只用过wxPython,配合Boa Constructor感觉还是很简单,可以实现拖拽的。
    chuhades
        10
    chuhades  
    OP
       2013-05-27 17:13:44 +08:00
    @thedevil5032 很多人推荐pyqt 哈...
    还有个问题,网上貌似没有很详细的书籍或教程,只有官方的文档(还是英文的...),有什么好的可以推荐么~
    chchwy
        11
    chchwy  
       2013-05-27 17:19:19 +08:00
    PyQt教程: http://zetcode.com/tutorials/pyqt4/

    中文就別想了,這目前還算小眾技術。
    thedevil5032
        12
    thedevil5032  
       2013-05-27 17:20:40 +08:00
    @chuhades 其实根据我自己的经验, PyQt 编程的学习方法主要是看代码和文档,特别是官方的英文文档。
    推荐书籍: Rapid GUI Programming with Python and PyQt. 附带很多例子, http://www.qtrac.eu/pyqtbook.html。

    ps. 很多人都会跟你说,做编程英语很重要。
    chuhades
        13
    chuhades  
    OP
       2013-05-27 17:20:50 +08:00
    @chchwy thx...
    chuhades
        14
    chuhades  
    OP
       2013-05-27 17:24:23 +08:00
    @thedevil5032 囧.. 我英语扔了将近一年了,尽力捡起来..
    shiweifu
        15
    shiweifu  
       2013-05-27 17:48:06 +08:00
    推荐tk
    chuhades
        16
    chuhades  
    OP
       2013-05-27 17:53:37 +08:00
    @shiweifu 看过几眼tk,感觉用它很折磨...
    RelativeLayout
        17
    RelativeLayout  
       2013-05-27 19:01:37 +08:00
    @yaotian 当然可以啊,你可以看他的demo,很完善的框架。
    xuelang
        18
    xuelang  
       2013-05-27 19:05:00 +08:00
    可以试下wxPython
    yaotian
        19
    yaotian  
       2013-05-27 20:44:06 +08:00
    @xuelang 具体在自己的项目中实践过吗? 例子总归是例子。我对这很感兴趣,想用到项目中,怕到一半做不下去了。
    meta
        20
    meta  
       2013-05-27 21:15:36 +08:00
    现在的图形界面不都是直接webkit了么。
    xuelang
        21
    xuelang  
       2013-05-27 21:56:57 +08:00
    loveshouhu
        22
    loveshouhu  
       2013-05-27 23:52:41 +08:00
    目测Qt还不错。。
    mckelvin
        23
    mckelvin  
       2013-05-28 15:00:28 +08:00
    PyQt很方便,可以用QtDesigner拖拖拉拉设计好界面,由ui文件直接生成对应的python GUI代码。

    https://github.com/mckelvin/doubanfm-for-linux 是我用PyQt写的豆瓣FM客户端
    chuhades
        24
    chuhades  
    OP
       2013-05-28 15:35:23 +08:00
    @mckelvin 看上去不错~
    ygmpkk
        25
    ygmpkk  
       2013-05-28 17:14:00 +08:00
    gully
        26
    gully  
       2013-06-02 12:21:25 +08:00
    wxPython很好用,社区支持也很好
    http://groups.google.com/group/wxpython-users
    wxPython的作者Robin基本上有问必答


    我使用好几年了,开发了几个公司内部使用的工具.开发和维护的效率都非常高.
    开源了其中的一个hex编辑器组件:
    https://github.com/deepgully/codes/tree/master/hexeditor

    PS. 强烈推荐使用sizer布局
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   999 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:45 · PVG 04:45 · LAX 13:45 · JFK 16:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.