Pastebin
Paste #1047: copy intersection
< previous paste - next paste>
Pasted by tdn
import os
A=os.listdir("A")
B=os.listdir("B")
os.mkdir("C")
for f in A:
print f
srcname = os.path.join("B", f)
dstname = os.path.join("C", f)
try:
print "copy2(%s,%s)" %(srcname, dstname)
copy2(srcname, dstname)
except (IOError, os.error), why:
print "Can't copy %s to %s: %s" % (`srcname`, `dstname`, str(why))
New Paste
Go to most recent paste.