How to install pyqt4 on ubuntu

来源:互联网 发布:apache benchmark 编辑:程序博客网 时间:2024/06/05 23:06
Install and run "hello world" example
  • apt-cache search pyqt
  • sudo apt-get install python-qt4
  • Create a file ~/tmp/helloworld.py
    import sysfrom 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
原创粉丝点击