import os
path = 'D:\zxx\contest2\csv_test'
files = os.listdir(path)
for i, file in enumerate(files):
NewName = os.path.join(path, str(i))
OldName = os.path.join(path, file)
os.rename(OldName, NewName)
import os
path = 'D:\zxx\contest2\csv_test'
files = os.listdir(path)
for i, file in enumerate(files):
NewName = os.path.join(path, str(i))
OldName = os.path.join(path, file)
os.rename(OldName, NewName)