monesimp = open(r'save.txt', 'w') print(str(monesimp)) monesimp.close() >>> <_io.TextIOWrapper name='save.txt' mode='w' encoding='cp1251'> >>>