I have a string that comes from a process' output, which seems to be unicode, and I can't compare it to a 'normal' string.
Here is the code:
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
result = re.match(r'#title#(?P<title>.*)#artist#(?P<artist>.*)#track#(?P<track>.*)#islive#(?P<islive>.*)', out.decode("utf-8"))
if result:
print(result.group('islive'))
print('na')
print(result.group('islive').lower() == 'na')
The output:
u'NA'
na
False
The python version is Python 3.6.5.
I need some help on how to compare these two strings.