[PyQt] RegExp and QString

Tiago Maluta maluta_tiago at yahoo.com.br
Mon Feb 11 06:22:53 GMT 2008


Hi,

Following Assistant (for C++) documentation about QString split method I 
saw:

str = "Now: this sentence fragment.";
list = str.split(QRegExp("\\b"));
// list: [ "", "Now", ": ", "this", " ", "sentence", " ", "fragment", "." ]

Now, I with python I tried, a simple example:


  line = p.readline()
  sline = line.split(QtCore.QRegExp("[A-Z]+"))

With this code I got: TypeError: PyQt expected a character buffer object.

I don't know how to fix it, if I try a delimiter just line.slipt(',') it 
works.

Some ideas?

-- Tiago


More information about the PyQt mailing list