import re def demicrosoft (fn): fn = re.sub('[()]', '', fn) for ch in [' ']: fn = fn.replace(ch,"_") return fn