关闭

How to install pyqt4 on ubuntu

697人阅读 评论(0) 收藏 举报
Install and run "hello world" example
  • apt-cache search pyqt
  • sudo apt-get install python-qt4
  • Create a file ~/tmp/helloworld.py
    import sys
    from PyQt4.QtGui import *
    app = QApplication(sys.argv)
    button = QPushButton("Hello World", None)
    button.show()
    app.exec_()
    
  • Run it:
    python ~/tmp/helloworld.py
    You should see a window with a single button pop up.

Install additional examples
  • For more examples, install the python-qt4-doc package:
    sudo apt-get install python-qt4-doc
  • After installation, the examples are located at:
    /usr/share/doc/python-qt4-doc/examples
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:32603次
    • 积分:580
    • 等级:
    • 排名:千里之外
    • 原创:25篇
    • 转载:1篇
    • 译文:0篇
    • 评论:14条
    文章分类
    最新评论