#encoding=utf8
import os

def rename(file_path,re_name,z_num=2):
	num = 0
	for file in os.listdir(file_path):
		num += 1
		file_name,ext_name = os.path.splitext(file)
		new_name = "%s_%s%s" % (re_name,str(num).zfill(z_num),ext_name)
		print os.path.join(file_path, file)
		print os.path.join(file_path, new_name)
		os.rename(os.path.join(file_path, file), os.path.join(file_path, new_name))

if __name__== "__main__":
	file_path = "/home/gabe/code/yiheni/static/home/img/health/"
	re_name = "icon"
	rename(file_path,re_name)

