我正在尝试使用tkiner.filedialog.askopenfile()打开一个文件(请参阅下面的代码)。我现在试着用open(words_file, 'r')打开它,但是得到了错误TypeError: expected str, bytes or os.PathLike object, not _io.TextIOWrapper如何打开_io.TextIOWrapper对象?我找到了,但不知道我</e
我在一个目录中有数千个文本文件,并且希望将每个文件的内容保存在一个列表(一个大文件列表)中,同时保持目录中文件的顺序。文本不应连在一起。请看我想要的输出的例子。one', 'textual content of file two', 'textual content of file three'.....textual content of file n] for file in filelist: