Here is the snippet:
for eachLine in content.splitlines(True):
entity = str(eachLine.encode("utf-8"))[1:]
splitResa = entity.split('\t')
print(entity)
print(splitResa)
Basically I am getting this result:
'<!ENTITY DOCUMENT_STATUS\t\t\t\t\t"draft">\n'
['\'<!ENTITY DOCUMENT_STATUS\\t\\t\\t\\t\\t"draft">\\n\'']
however in IDLE it all works fine:
>>> '<!ENTITY DOCUMENT_STATUS\t\t\t\t\t"draft">\n'.split('\t')
['<!ENTITY DOCUMENT_STATUS', '', '', '', '', '"draft">\n']
Couldn't figure out why. I've also tried answers here: splitting a string based on tab in the file But it still does the same behaviour. What is the issue here?