This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
paths = (os.path.join(root, filename) | |
for root, _, filenames in os.walk('C:\FolderName') | |
for filename in filenames) | |
for path in paths: | |
# the '#' in the example below will be replaced by the '-' in the filenames in the directory | |
newname = path.replace('#', '-') | |
if newname != path: |