Bulk edit extension

OS Import 

path = INPUT ( 'Enter file path (the end of the plus /):')

# obtain all files in the directory, a list stored in
the fileList the os.listdir = (path)

n-= 0
for I in the fileList:
# Set old file name (path + file name is a)
oldname path = + + os.sep the fileList [n-] Add # os.sep separator system

# set the new file name
newname = path + os.sep + str ( n + 1) + '.PNG'

os.rename (oldname, newname) method # os by rename file rename module
Print (oldname, '======>', newname)

n-+. 1 =

Guess you like

Origin www.cnblogs.com/10439-y/p/11788176.html