I want to change the name of the file I am extracting to something new:
i = 0
for file in zip_file.namelist():
path = 'C:\test\object'
zip_file.extract(file, path) #Change name here of file
i+=1
Is it possible to change the name of file
to something like str(i)+'_'+'file'
? I know I can use shutil.move()
, but I want to maintain my style, if possible.