Skip to content

Instantly share code, notes, and snippets.

@ccbikai
Created November 7, 2013 15:09
Show Gist options
  • Save ccbikai/7356155 to your computer and use it in GitHub Desktop.
Save ccbikai/7356155 to your computer and use it in GitHub Desktop.
python批量修改文件名后缀
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