2
I have to make a comparison between 2 items, one is in Unicode, and the other is in str, being that what is like str is an array.
for bloqueiosPermanentes in arquivo:
self.blocks.append(bloqueiosPermanentes.replace("\n", ""))
This is how the append is made in the variable Blocks..
afterward
for n in j['userList']:
nicks.append(n['nick'])
this is how the append on the variable nicks is made, it gets its value from a json file pulled from the internet.
Error occurs in the following comparison
for o in nicks:
if o==self.lblNick.text(): << dá erro aqui na comparacao dos formatos
pass
else:
if o in self.blocks: <<< dá aqui o erro aqui na comparacao dos formatos
pass
I already tried to use . toUtf8() and Unicode(variable) but none of them had an effect all are not allowed
If you could pass a few examples of the entries it would be a good one to test possible solutions.
– Math
Try to put a print of the error
– LuKs Sys
Misses or gives
False
?– sergiopereira
Specify whether you are using Python 2 or Python 3. String and Unicode have many differences between these versions.
– Marcelo Theodoro