Pastebin

Paste #1047: copy intersection

< previous paste - next paste>

Pasted by tdn

Download View as text

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


Do not write anything in this field if you're a human.

Go to most recent paste.