AwaitedOne AwaitedOne - 8 months ago 33
Python Question

AttributeError: 'QString' object has no attribute 'find'

Indeed this question is asked many times, but could not find anything to solve my problem. I have many modules in my python project and it works fine, however on creating executable of that project i get error:

AttributeError: 'QString' object has no attribute 'find'

Unfortunately i could not make a reproducible example, as the code is so large. But the error comes from the line, which is to accept user input

input = self.builselcom.currentText()

which holds something like

I have the index of the above line

tofind = ".bt2"

and try to find by


Note: Project works fine, but error with executable.


You need to convert the user input to string. It should work by just adding str to input = str(self.builselcom.currentText()). Hope this is helpful.