Pastebin
Paste #1048: copy intersection
< previous paste - next paste>
Pasted by tdn
import os import shutil A=os.listdir("A") B=os.listdir("B") os.mkdir("C") for f in A: srcname = os.path.join("B", f) dstname = os.path.join("C", f) try: shutil.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.