Notes
Before using os, you have to first import os module.
import os
os.chdir(path)
Change the current working directory to path.
import os
os.chdir("C:\\")
os.listdir(path)
Return a list containing the names of the entries in the directory given by path.
import os
path = "C:\\"
files = os.listdir(path)
for file in files:
print(file)
os.rename(old,new)
Rename the file or directory old to new.
import os
os.chdir("C:\\")
os.rename("A.txt","B.txt")