Hi all this is the code I am trying to run. I am not a computer scientist and I know this is an easy answer I just do not have the tools to answer it. I am trying to get this list printed to a text file. It works if I print to screen. The error I get is this: "TypeError: expected a character buffer object"
here is the code
input = open('Tyger.txt', 'r')
text = input.read()
wordlist = text.split()
output_file = open ('FrequencyList.txt','w')
wordfreq = [wordlist.count(p) for p in wordlist]
#Pair words with corresponding frequency
dictionary = dict(zip(wordlist,wordfreq))
#Sort by inverse Frequency and print
aux = [(dictionary[key], key) for key in dictionary]
aux.sort()
aux.reverse()
for a in aux: output_file.write(a)
Thanks!