import os subprocess f_source_names Users Sensor Desktop Новая папка f

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import os, subprocess
f_source_names = r'C:\Users\Sensor\Desktop\Новая папка'
f_source_files = r'\\_SERVER\public\shi-shi\new'
f_to_copy= r'c:\test\zzz\new'
l_source_files = os.listdir(f_source_files)
for i in os.listdir(f_source_names):
if i in l_source_files:
fn = i.rstrip()
print 'Copy %s...' % fn
subprocess.call('copy /Z %s %s' % (f_source_files+'\\'+fn, f_to_copy+'\\'+fn), shell=True)