Tuesday, December 31, 2013

Install PySide for Python 2 on Raspberry Pi

PySide is an open source software project providing Python bindings for the Qt framework. To install PySide for Python 2 on Raspberry Pi, enter the command:
$ sudo apt-get install python-pyside

In Python, or IDLE, enter:

import PySide

If no error reported, means PySide installed successfully.
To check the installed version of PySide, enter:

PySide.__version__

Currently, version 1.1.1 installed.


"Hello World" of PySide for Python

Create a py module with the code, and run it.
#!/usr/bin/python

import sys
from PySide.QtCore import *
from PySide.QtGui import *

app = QApplication(sys.argv)
label=QLabel("Hello World")
label.show()
app.exec_()
sys.exit()

"Hello World" of PySide for Python
"Hello World" of PySide for Python





Related: Install PySide for Python 3 on Raspberry Pi

No comments: