PyQT4 – the start

Today I installed the updated version of pythonxy on my old XP box. This is a great package as a whole load of scientific modules are also installed with it. I used Qt Designer to create a couple of GUIs. All well and good, but the next thing will be to work out how to attach code to the GUI. Code such as that below, which creates an “open file” dialog:

from PyQt4.QtCore import *

from PyQt4.QtGui import *

filename = QFileDialog.getOpenFileName(None, 'Open File', '.')
fname = open(filename)
data = fname.read()
fname.close()
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

A WordPress.com Website.

Up ↑

%d bloggers like this: