How to move a list of files (the list contains path + filename) in python?

202 views Asked by At

I have a list like this:

 ../../topics/A100/A100/A.dita
 ../../topics/A100/A200/B.dita
 ../../topics/A100/A300/C.dita

I have a folder named _inactive in the A100, A200, A300 folders. I want to move the files referenced in the list to the _inactive fodler in the file's folder.

I tried shutil.move without success.

for z in maradek:
    shutil.move(z, '_inactive')
1

There are 1 answers

0
oliversm On

Try using the os module. Then perhaps os.system('mv path/to/file destination/of/file').