1import os
2for dirname in os.listdir("."):
3 if os.path.isdir(dirname):
4 for i, filename in enumerate(os.listdir(dirname)):
5 os.rename(dirname + "/" + filename, dirname + "/" + str(i) + ".bmp")
6
1import os
2os.rename(r'C:\Users\Ron\Desktop\Test\Products.txt',r'C:\Users\Ron\Desktop\Test\Shipped Products.txt')
3