When I try to print a PyQT string, it is not converted to a normal string. How can I do it? See the code below.
def _execute_test(self):
test_in = str(self.buildFlags.inFlags)
test_out = str(self.buildFlags.exFlags)
print(str(test_in))
print("============")
print(str(test_out))
The output I get is:
>>> [PyQt4.QtCore.QString(u'Documents'), PyQt4.QtCore.QString(u'New folder')]
If you want to print a list of string from a list of PyQt4.QtCore.QString try this:
print([str(x) for x in my_qstring_list])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With