同步更改数据
This commit is contained in:
1 parent
ecb58b2f59
commit
33ba8bb357
21 files changed
+2019472
-63
No files matched your search
@@ -0,0 +1,44 @@
|
||||
|
||||
import os
|
||||
import shutil
|
||||
#遍历 G:\obj_fix\print\wrong 文件 获取到pid
|
||||
|
||||
workdir = 'G:\obj_fix\print'
|
||||
# output = 'G:\obj_fix\ply\whole_obj_bake_vertex_high_ply'
|
||||
directory = f'G:\obj_fix/print/wrong'
|
||||
#遍历获取 G:\obj_fix\print\right 目录的文件,根据文件名获取 pid
|
||||
|
||||
arrWrongFiles = []
|
||||
for file_name in os.listdir(directory):
|
||||
# # 获取文件的完整路径
|
||||
# file_path = os.path.join(directory, file_name)
|
||||
# # 检查是否是文件
|
||||
# if os.path.isfile(file_path):
|
||||
# #
|
||||
|
||||
arrFileName = file_name.split('_')
|
||||
pid = arrFileName[0]
|
||||
if int(pid) == 0:
|
||||
continue
|
||||
|
||||
arrWrongFiles.append(pid)
|
||||
|
||||
#遍历 G:\obj_fix\print\preview 文件 获取到pid
|
||||
directory = f'G:\obj_fix/print/preview'
|
||||
for file_name in os.listdir(directory):
|
||||
arrFileName = file_name.split('_')
|
||||
pid = arrFileName[0]
|
||||
if int(pid) == 0:
|
||||
continue
|
||||
|
||||
if pid in arrWrongFiles:
|
||||
continue
|
||||
|
||||
#判断right目录中是否已经存在该pid的文件
|
||||
if os.path.exists(f'G:\obj_fix/print/right/{file_name}'):
|
||||
continue
|
||||
|
||||
print("new_pid",pid)
|
||||
#不在arrWrongFiles中的pid,就是正确的pid要复制到right目录
|
||||
filePath = os.path.join(directory, file_name)
|
||||
shutil.copy(filePath, f'G:\obj_fix/print/right/{file_name}')
|
||||
Reference in new issue
Block a user