Код: Выделить всё
word = win32.gencache.EnsureDispatch('Word.Application')
word.Visible = False
doc = word.Documents.Open(file_path)
# Get Word's internal statistics
doc.Content.ComputeStatistics(win32.constants.wdStatisticWords) # Trigger recalculation
# Get readability statistics
stats = doc.ReadabilityStatistics
flesch_reading_ease = stats.Item('Flesch Reading Ease').Value
flesch_kincaid_grade_level = stats.Item('Flesch-Kincaid Grade Level').Value
Почему они отличаются, если win32com напрямую использует объект из приложения Word? Это проблема с тем, как Word подсчитывает баллы, или Word не полностью выдает ожидаемые значения?
Подробнее здесь: https://stackoverflow.com/questions/793 ... gui-output