[Tutor] moving files from one dir to another

Matt Herzog msh at blisses.org
Mon May 11 22:22:36 CEST 2009

Should be simple, right? Not for me, heh.

def schmove(src,dst):
...         src = '/home/datasvcs/PIG/cjomeda_exp/'
...         dst = '/home/datasvcs/PIG/cjomeda_exp_archive/'
...         listOfFiles = os.listdir(src)
...         for filez in listOfFiles:
...             os.system("mv"+ " " + src + " " + dst)

The above code does not copy anything. I sure wish it would spit just one error.

I sure wish I could for the last line go, 

shutil.move("src", "dest")

That would be cool.

Plz halp!

I fear you speak upon the rack,
Where men enforced do speak anything.

- William Shakespeare

More information about the Tutor mailing list