Created
November 7, 2013 15:09
-
-
Save ccbikai/7356155 to your computer and use it in GitHub Desktop.
python批量修改文件名后缀
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 | |
def change_suffix(dir_path): | |
for name in os.listdir(dir_path): | |
new_name=name.replace('.markdown','.md') | |
os.rename(name,new_name) | |
change_suffix(".") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment