15 lines
734 B
Python
15 lines
734 B
Python
import os,sys,json,io #导入模块
|
|
def add_prefix_subfolders(): #定义函数名称
|
|
final = 'd:\\project\\DB\\DragonBall_3\\copy_png'
|
|
for copyfiles in os.listdir(final):
|
|
copypath = os.path.join(final,copyfiles)
|
|
with io.open(copypath,'r',encoding='utf-8') as fp:
|
|
json_data = json.load(fp)
|
|
#png,jpg 使用uuid plist使用rawTextureUuid
|
|
uuid = json_data['uuid']
|
|
if copyfiles!= sys.argv[0]:
|
|
os.rename(os.path.join(final,copyfiles),os.path.join(final,uuid+"@"+copyfiles)) #子文件夹重命名
|
|
print (copyfiles,"has been renamed successfully! New name is: ",uuid)
|
|
|
|
add_prefix_subfolders() #调用定义的函数
|