I have printed the contents of 2 folders to separate txt files. It is in the form of a python list How could I loop through the files looking for matching list elements? My first problem is how to extract the words from out of the quotes and the second should come easily since I would just have to find that same pattern in the 2nd txt file. Any ideas?
Do I need to convert the 2 lists to strings before I can search each? Because I used list.count('the') and it returned 0.. Which there should be almost 300 cases of 'the' in this.
I have this at the moment:
# Define variables for the 2 lists
mu1List = os.listdir('M:\Music')
mu2List = os.listdir('H:\Music')
def compare(): # cycle through items in list
# find each item from list1 in list2
# if item isn't found, print item to screen
for item in mu1List: