I'm trying to look at the readability scores for a text file using this Python code:
posts = open("/Users/jchavis/Desktop/Data/posts.txt","r")
readability_scores = Textatistic(posts).scores
flesch = readability_scores['flesch_score']
print('The Flesch Reading Ease is %.2f' % (flesch))
However, I receive this error:
AttributeError: '_io.TextIOWrapper' object has no attribute 'replace'
I'm not sure what needs to be corrected. Any help would be greatly appreciated!