1

How could I append the file name with other characters, before the extension.

For example, I have

f = open ('text.txt', 'r')

Desired output: g = ('text_done.txt')

ray
  • 5,454
  • 1
  • 18
  • 40
Cristian
  • 19
  • 1
  • 2
    Does this answer your question? [How to rename a file using Python](https://stackoverflow.com/questions/2491222/how-to-rename-a-file-using-python) – Grismar Nov 28 '19 at 01:11

1 Answers1

0

you can import os on django in order to manipulate the file name. something like this

import os
os.rename(r'text.txt',r'text_done.txt')