Thursday, November 25, 2010

Getting started with pyside - Python for Qt

Pyside lets us to develop Qt applications using python language. I started to trying out pyside recently. And I will be writing my pyside learning in the form of tutorial as my learning progresses.

Here are the steps to get started in pyside:
1. Download and install python 2.7 from here: http://www.python.org/download/
exact URL used by me: http://www.python.org/ftp/python/2.7/python-2.7.msi
pyside doesn't support python 3.x yet.

2. After that add the python path to the environmental variables in the windows. If we run python in command window, we should get the following result to confirm python is installed correctly :

C:\>python
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>


3. download pyside and install it. I used the windows binary for python 2.7 from here: http://developer.qt.nokia.com/wiki/PySideBinariesWindows

Direct URL to download this: http://www.pyside.org/files/pkg/PySide-0.4.2qt47.win32-py2.7.exe

3.a. In ubuntu linux(version 10.04 & 10.10) pyside can be installed using the following commands:

sudo add-apt-repository ppa:pyside
sudo apt-get update
sudo apt-get install python-pyside


4.After its done, run the following hello world python script:


import sys
from PySide import QtCore, QtGui

app = QtGui.QApplication(sys.argv)

win = QtGui.QWidget()

win.resize(320, 240)
win.setWindowTitle("Hello, World!")
win.show()

sys.exit(app.exec_())



If you are able to get a window launched, then it confirms that you have pyside installed in your system and ready to explore pyside in detail.

6. optional- Once you have learned the basics, you might want to take advantage of the Qt tools like Qt Designer to speed up your development. Those tools are available as part of the Qt SDK download. You can download Qt SDK for windows from here:
http://qt.nokia.com/downloads

7. Optional - You can speed up your Pyside learning by following the examples given in pyside website.
You can download the examples package from this URL: http://qt.gitorious.org/pyside/pyside-examples/archive-tarball/master

5 comments:

nithya raghuvaran said...

Best SAP FICO Training Institute in Chennai pallavaram chrompet guindy T.Nagar Poonamallee Vadapalani Anna Nagar

http://thecreatingexperts.com/sap-fico-training-in-chennai/

Anshuman Tripathi said...

Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up.Data Science training in Pune

Merlin Kristianti said...

agar menang dalam taruhan atau putaran permainan. Dengan menggunakan mantras seperti ini tentu saja buat sebagian orang dinaggap jadi diantaranya tentang yang memudahkan untuk menang.
asikqq
dewaqq
sumoqq
interqq
pionpoker
bandar ceme terpercaya
hobiqq
paito warna
forum prediksi

Ar Godara said...

आपकी साइट पर कुछ बेहतरीन लेख देखकर मुझे खुशी हुई। मैं वास्तव में इसकी सराहना करता हूं, साझा करने के लिए बहुत धन्यवाद धन्यवाद आपka

gourideb said...


Great beat ! I wish to apprentice while you amend your web site, how can i subscribe for a blog website?
The account helped me a acceptable deal. I had been a little bit acquainted of
this your broadcast offered bright clear concept
best polytechnic college in West Bengal