您的位置:首页 > 编程语言 > Qt开发

How to install pyqt4 on ubuntu

2013-12-06 10:59 267 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: