When I got the number of how many times of the words, I wanted to save the output to a txt file. But when I used the following code, only counts appeared in the output file. Anyone knows the problem here?
Thank you very much!
My code: (part)
d = c.split() # make a string into a list of words
#print d
counts = Counter(d) # count the words
print(counts)
import sys
sys.stdout = open("C:/Users/Administrator/Desktop/out.txt", "w")
print 'counts'
print 'counts ', countsinstead?