title: Copy file with specific name from one folder to another in python
body: <p>I am trying to copy specific files from one folder to another but I get an error I don't understand why :</p>
  <pre><code>import os
  import shutil
  
  def setPath_getData():        
          # Set up folders for data
      newpath = r'userdata' 
      if not os.path.exists(newpath):
          os.makedirs(newpath)
          os.makedirs('userdata/sleep')
          os.makedirs(r'userdata/distance')
          os.makedirs(r'userdata/steps')
          os.makedirs(r'userdata/lightly')
          os.makedirs(r'userdata/mod')
          os.makedirs(r'userdata/sedentary')
          os.makedirs(r'userdata/very')
          os.makedirs(r'userdata/heart-rate-zone')
          os.makedirs(r'userdata/heart-rate')
          
          
              # Get data from fitbit
          filenames = os.listdir(&quot;user-site-export&quot;)
          unique_filenames = set()
          for f in filenames:
              unique_filenames.add(f.split(&quot;-&quot;)[0])
          
          source = os.listdir('user-site-export/')
          dest = '/userdata/sleep/'
          
          for file in source:
              if file.startswith('sleep'):
                  shutil.copy(file, dest)
              
              #ls userdata/
      print(&quot;Data loaded successfully&quot;)
  
  setPath_getData()
  </code></pre>
  <p>the error it gives is :</p>
  <pre><code>FileNotFoundError: [Errno 2] No such file or directory: 'sleep-2020-01-09.json'
  </code></pre>
  <p>So it looks like it is fetching the correct files but it does not copy them to dest. Any ideas why ?</p>