I'm working with a couple of lists that have unicode values in them. I'm comparing values in one list to see if those values exist in the second list. Then I'm trying to take the matching values from the second list and put them in a third list. When I try to print the third list, it returns 'None'. What am I missing? Feedback is greatly appreciated!
# -*- coding: utf-8 -*-
import os
def GetFilepaths(directory):
file_paths = []
for root, directories, files in os.walk(directory):
for filename in files:
filepath = os.path.join(root, filename)
file_paths.append(filepath)
return file_paths
umlauts = [u'Ä', u'Ü', u'Ö', u'ä', u'ö', u'ü']
filePathsList = GetFilepaths(u'C:\\Scripts\\Replace Characters\\Umlauts')
filesWithUmlauts = []
for files in filePathsList:
for umlaut in umlauts:
if umlaut in files:
filesUmlautPaths = filepathsUmlauts.append(files)
print filesUmlautPaths