python change file names in a directory code example
Example 1: python rename file
import os
os.rename('guru99.txt','career.guru99.txt')
Example 2: rename file python
import os
os.rename('old_name.txt','new_name.txt')
Example 3: get file names in folder python
from os import listdir
from os.path import isfile, join
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]