Python中要统计txt文件字数可以rstrip函数和len函数进行。如下统计白夜行.txt的字数:file_name = '白夜行.txt'try: with open(file_name, encoding='utf8') as...