return playing
while True:
    with io.open('currentsongspotify.txt', encoding='utf8') as filetxt:
        oldtitle = filetxt.read()
newtitle = currentplaying()
if newtitle == oldtitle:
    time.sleep(1)
else:
    with io.open('currentsongspotify.txt', 'w', encoding='utf8') as filetxt:
        filetxt.write(newtitle)
print('new file saved:', newtitle)
Python; How to replace escaped non-unicode characters with their respective 'real' utf-8