Below you will find pages that utilize the taxonomy term “programming”
March 6, 2010
PyKDE4: new style signals and slots
Those who use PyQt and PyKDE4 are certainly familiar with the syntax used to connect signals and slots:
[python] from PyQt4 import QtCore from PyQt4 import QtGui from PyKDE4 import kdeui
class MyGUI(QtGui.QWidget):
def __init__(self, parent=None): super(MyGUI, self).__init__(parent) self.pushbutton = kdeui.KPushButton() self.pushbutton.setText("Push me!") QObject.connect(self.pushbutton, QtCore.SIGNAL("clicked()"), self.button_pushed) def button_pushed(self): print "Button clicked" [/python]
The main advantage of this syntax is that it’s very close to the C++ equivalent, and so you can translate easily from C++ to Python.
October 12, 2008
DataMatrix page up
Ok, ok… my definition of “tomorrow” is not like what most people use, apparently. Although I took quite a while, now [there is a static page on DataMatrix]({{ site.url }}/projects-2/datamatrix). There you will find a summary of wht I wrote in my other blog posts regarding this module. Of course, it will be kept up-to-date should I release a new version.
Aside that, I put a contact form on this blog.
September 19, 2008
DataMatrix 0.5
At last, since it’s been like ages, I decided to put out a new version of DataMatrix. For those who haven’t seen my previous post, DataMatrix is a Pythonic implementation of R’s data.frame. It enables you to manipulate a text file by columns or rows, to your liking, using a dictionary-like syntax.
In this new version there have been a few improvements and correction to a couple bugs (for example saveMatrix did not really save) and the start (only a stub at the moment) of an append function to add more columns (I’ll also think about a function to add rows).
June 29, 2008
data.frames in Python - DataMatrix
For a long time I have tried to handle text files in Python in the same way that R’s data.frame does - that is, direct access to columns and rows of a loaded text file. As I don’t like R at all, I struggled to find a Pythonic equivalent, and since I found none, I decided to eat my own food and write an implementation, which is what you’ll find below.
December 28, 2007
QSql vs DB-API?
I’ve recently begun trying to create GUIs for my Python applications with PyQt, and I can say I’m absolutely loving the toolkit, relatively easy to use and featureful. As I’m trying to create a GUI for some module I wrote that deals with databases (using MySQLdb), I also learnt that Qt has a series of classes for dealing with databases, mainly QSql.
My question, directed to whoever has experience with QSql and the Python DB-API, is: what are the advantages of one approach to the other?