[PyKDE] addressbook.py example from pyqt folder doesn't work

Giuseppe Calà jiveaxe at gmail.com
Tue Apr 18 10:07:19 BST 2006

Hi to everybody,
I am a beginner in python and qt so, I said,  why not to start from PyQt?
So I installed sip 4.4.1 and pyqt 3.16 on my Suse 10.0 64bit with python
2.4.1 and qt3-3.3.5-36 (python and qt from SuSE's rpm repository)

After spending some days with QT Designer and Python's tutorials I began to
work on my first application, a sms client. Among the others widgets, I used
a QListView to manage an addressbook, taking ispiration from a similar
example in the pyqt source package. But I discovered that the
addressbook.pyexample doesn't work properly: in particular the 'save'
function to store in
a text file the content of the ListView. When I click 'Save' in the File
menu, the first time it doesn't create the text file I choose in the
FileDialog; if I click a second time on File->Save it creates the text file
but it's empty. I tried also to use the ListViewItemIterator commenting out
lines 102-105 and uncommenting lines 100, 106-108, but I get the following

Traceback (most recent call last):
  File "addressbook.py", line 431, in fileSave
    self.view.save( self.filename )
  File "addressbook.py", line 106, in save
    for it in it.current():
TypeError: iteration over non-sequence

The error is in the addressbook.py example or, propably, in my system?

Thanks a lot for the help and sorry for my, not so good, english, I'm

Bye, Giuseppe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20060418/ddf97f1a/attachment.html

More information about the PyQt mailing list