Thanks!


On May 14, 2009, at 9:44 PM, Aaron Racicot wrote:

Try:

outfile.write(str(lineStr))
outfile.write(str(dateStr))

Hope that helps...

A

--------------------------
Aaron Racicot
Z-Pulley Inc.


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Scott Frankel
Sent: Thursday, May 14, 2009 9:02 PM
To: [email protected]
Subject: [PyQt] string printing question


How does one convert from QString and QBytArray values to plain ascii
strings for printing?

I would like to print plain ascii text to a file, based on values I
glean from QLineEdit and QDateEdit fields.  eg:

self.theLineEdit          = QtGui.QLineEdit()
self.theDateEdit          = QtGui.QDateEdit()
lineStr = self.theLineEdit .text()
dateStr = theDateEdit.text()
outfile.write(lineStr)
outfile.write(dateStr)


This yields:

PyQt4.QtCore.QString(u'foo')
PyQt4.QtCore.QByteArray('5/14/09')

When what I want is:

foo
5/14/09

I've tried using toAscii(), toLatin1(), etc., with no change.

Thanks in advance,
Scott


_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



Scott Frankel
President/VFX Supervisor
Circle-S Studios

www.circlesfx.com
510-339-7477 (o)
510-332-2990 (c)








_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to