What's an efficient way to remove a list of special characters from a filename? I want to replace 'spaces' with '.' and '(', ')', '[',']' with '_'. I can do it for one, but I'm not sure how to rename multiple characters.
import os
import sys
files = os.listdir(os.getcwd())
for f in files:
os.rename(f, f.replace(' ', '.'))