我正在编写一个脚本来自动将一个文件中的特定文本集更改为另一个文件中具有不同名称的特定集.
我想使用该askopenfilename函数获取文件的名称,但是当我尝试打印文件名时,它返回:
<_io.TextIOWrapper name='/home/rest/of/file/path/that/I/actually/need.txt' mode='w' encoding='ANSI_X3.4-1968'>
我只需要文件名,因为<_io.TextIOWrapper ...>它不是子脚本.
任何删除无关位的建议?