[PyQt] Help on "self"
David Arnold
dwarnold45 at suddenlink.net
Thu Feb 11 20:49:56 GMT 2010
Hi,
I'm not new to Python, but the use of "self" in classes has always been confusing. I working thru Rapid Gui Programming, and I have this code from Chatper 5:
import sys
from PyQt4.QtGui import *
class PenPropertiesDlg(QDialog):
def __init__(self, parent=None):
super(PenPropertiesDlg, self).__init__(parent)
widthLabel=QLabel("&Width")
self.widthSpinBox=QSpinBox()
Can someone "gently" explain why the author did not use self.widthLabel=QLabel("&Width").
Thanks.
David.
More information about the PyQt
mailing list