Apuntes_Python/04_seis_proyectos/02_RenamingBulkFiles/main.py
2022-12-24 22:41:20 -03:00

19 lines
354 B
Python

"""
Renombrar todos los archivos del directorio ./test/
"""
import os
def main():
i = 0
path = './test/'
for filename in os.listdir(path):
my_dest = 'renom_' + str(i)
my_source = path + filename
my_dest = path + my_dest
os.rename(my_source, my_dest)
i += 1
if __name__ == '__main__':
main()