title: How do I move a percentage of files (70%/ 15% /15% split) to different directories?
body: <p>I created a list of files in a directory using os.listdir(), and I'm trying to move percentages of the files(which are images) to different folders. So, I'm trying to move 70%, 15%, and 15% of the files to three different target folders.</p>
  <p>Here is a slice of the file list:</p>
  <pre><code>print(cnv_list[0:5])
  ['CNV-9890872-5.jpeg', 'CNV-9911627-97.jpeg', 'CNV-9935363-11.jpeg', 'CNV-9911627-15.jpeg', 'CNV-9935363-118.jpeg']
  </code></pre>
  <p>So, I'm trying to send 70% of these files to one folder, 15% of them to another folder, and 15% to a third folder.</p>
  <p>I saw this code below in another answer here which addresses how to move files, but not my specific question around percentages of those files:
  <a href="https://stackoverflow.com/questions/41826868/moving-all-files-from-one-directory-to-another-using-python">Moving all files from one directory to another using Python</a></p>
  <pre><code>import shutil
  import os
      
  source_dir = '/path/to/source_folder'
  target_dir = '/path/to/dest_folder'
      
  file_names = os.listdir(source_dir)
      
  for file_name in file_names:
      shutil.move(os.path.join(source_dir, file_name), target_dir)
  </code></pre>