- 2
Hi. Can anybody give me a piece of advice with file renaming?
The quest is: there is a folder with over 300 mp3 files. I want to write a program by Python to rename each file using random letters. Any ideas what to start with?
5 odpowiedzi
+ 3
I don't think it is possible. Don't be lazy!
+ 2
@yuri neither lazy nor stupid
does it work? looks good!
+ 1
Works pretty good
0
Lazy is better than stupid. Thanks anyway. Just take a look.
import os
path = input("Path: ")
for i, filename in enumerate (os.listdir+path)):
os.chdir(path)
os.rename(filename,'somename{}.mp3'.format(i+1)