I have this little script that changes characters from the beginning of filenames in the directory script is ran in. I would like to let the user input the directory to change files in. Im not sure how to implement that.
#!/usr/bin/env python3
import os
place = input("Enter the directory the files are in ")
drop = input("Enter text to remove from filename ")
add = input("Enter text to add to filename ")
for filename in os.listdir("."):
if filename.startswith(drop):
os.rename(filename, add+filename[len(drop):])