Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

moving files from multiple locations to a single location using Python

I have a long list of files from multiple folders and I would like to have them all in a single location so far I have:

import os
import shutil

dest_folder = 'C:\\dest_folder'
files = [
    'file1.csv', 'file2.csv',
    'file3.csv',
    ]
 for f in files:
    shutil.copy(f, 'dest_folder')

This is not working for me and I cant seem to figure out why, any help would be great, thanks

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I’m not very familiar with this kind of stuff, but I’m not sure if you meant to have ‘dest_folder’ in quotes at the end.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading