Here's one way to generate a list of all words that appear in either document:
infile1 = open("1.txt", 'r')
infile2 = open("2.txt", 'r')
data1 = infile1.read()
data2 = infile2.read()
#close files
infile1.close()
infile2.close()
# replace all dots with empty string
data1 = data1.replace('.', '')
data2 = data2.replace('.', '')
# split words in data (splitted by whitespace) and save in words
words1 = data1.split()
words2 = data2.split()
#create combined list
combinedList = []
for word in words1:
if word not in combinedList:
combinedList.append(word)
for word in words2:
if word not in combinedList:
combinedList.append(word)
print(combinedList)