Skip to content

Instantly share code, notes, and snippets.

@lyhapple
Created December 16, 2013 08:55
Show Gist options
  • Select an option

  • Save lyhapple/7984106 to your computer and use it in GitHub Desktop.

Select an option

Save lyhapple/7984106 to your computer and use it in GitHub Desktop.
rename file name
#coding=utf-8
__author__ = 'lyhapple'
import os
dir_path = '%s' % u'D:\\迅雷下载\\'
for name in os.listdir(dir_path):
new_name = name.replace(u" 标清", "").replace("9vcd-", "")
print new_name
os.rename(dir_path + name, dir_path + new_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment