I am writing a script to automate changing a particular set of text in one file into a particular set in another with a different name.
I want to get the name of the file using the askopenfilename
function, but when I try to print the file name, it returns:
<_io.TextIOWrapper name='/home/rest/of/file/path/that/I/actually/need.txt' mode='w' encoding='ANSI_X3.4-1968'>
I need just the file name because the <_io.TextIOWrapper ...>
is not sub scriptable.
Any suggestions to remove the extraneous bits?