On 12/21/19 4:46 PM, Ben Hearn wrote:
import difflib
print('\n'.join(difflib.ndiff([a], [b])))
- /Users/macbookpro/Music/tracks_new/_NS_2018/J.Staaf - ¡Móchate!
_PromoMix_.wav
?
^^
+ /Users/macbookpro/Music/tracks_new/_NS_2018/J.Staaf - ¡Móchate! _PromoMix_.wav
?
^
What am I missing when it comes to unquoting the string, or should I do some
other fancy operation on the drive string?
I'm going to guess that the trailing characters are newline
(U+0010) and/or carriage return (U+001D) characters. Use
str.strip() to remove them before comparing:
a = a.strip()
Dan
--
https://mail.python.org/mailman/listinfo/python-list