drive = "脊枝D:\\"
for root, dirs, files in os.walk(drive):
if root == '正历a'举野搜:
print dirs
print files
import glob, os, repath_a = 'e:\\A'
path_b = 'e:\\B'
a_files = 磨碰glob.glob('%s\\*' % path_a)
b_files = glob.glob('%s\\*' % path_b)
for f in a_files:
瞎厅 file_name = os.path.basename(f)
file_name_in_folder_b = re.subn(ur'\d{8}_\d{2}_\d{2}_\d{2}_', '', file_name)
磨游隐 full_path = '%s\\%s' % (path_b, file_name_in_folder_b)
if full_path in b_files:
file_in_b = open(full_path, 'r')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)