title: Copy a file from one location to another in Python
body: <p>I have a list called <strong>fileList</strong> containing thousands of filenames and sizes something like this:</p>
  
  <pre><code>['/home/rob/Pictures/some/folder/picture one something.jpg', '143452']
  ['/home/rob/Pictures/some/other/folder/pictureBlah.jpg', '473642']
  ['/home/rob/Pictures/folder/blahblahpicture filename.jpg', '345345']
  </code></pre>
  
  <p>I want to copy the files using fileList[0] as the source but to another whole destination.  Something like:</p>
  
  <pre><code>copyFile(fileList[0], destinationFolder)
  </code></pre>
  
  <p>and have it copy the file to that location.</p>
  
  <p>When I try this like so:</p>
  
  <pre><code>for item in fileList:
      copyfile(item[0], "/Users/username/Desktop/testPhotos")
  </code></pre>
  
  <p>I get an error like the following:</p>
  
  <pre><code>with open(dst, 'wb') as fdst:
  IsADirectoryError: [Errno 21] Is a directory: '/Users/username/Desktop/testPhotos'
  </code></pre>
  
  <p>What could be something I could look at to get this working? I'm using Python&nbsp;3 on a Mac and on Linux.</p>