[PyKDE] function name collision

Fábio Sato sato at simepar.br
Wed Jul 23 22:07:00 BST 2003


I've just started to program in Python and I'm trying to create a small GUI 
software using PyQt. 

However I'm having an odd error that I don't know how to solve.

The problem is occurring is this line of my code:
 idx = string.find(self.lineEdit1, ":")

It issues an error that seems to be a "function name collision" of the find() 
function of the Python's string module and the find() function of the QWidget 
class:

Traceback (most recent call last):
>  File "./accel.py", line 105, in startDownload
>    idx = string.find(self.lineEdit1, ":")
>  File "/usr/lib/python2.2/string.py", line 174, in find
>    return s.find(*args)
>TypeError: Argument 1 of QWidget.find() has an invalid type

I'm importing the modules in the following way:

import sys
from qt import QApplication, QMainWindow, QLabel, QPushButton, QRect, 
QLineEdit, QSpinBox, QProgressBar, QSizePolicy, SIGNAL, SLOT, QSize, Qt
from qttable import QTable
import string
from string import *


Does anyone knows how to solve this?

Thanks!
-- 
Fábio Sato




More information about the PyQt mailing list