title: recursive file copying into subdirectory
body: <p>I need to copy all the files and folders to the current folder to a subdirectory. What would be the best way to do so? I tried the following snippet but it fails as it fails if the destination directory already exists.</p>
  
  <pre><code>def copy(d=os.path.curdir):
      dest = "t"
      for i in os.listdir(d):
          if os.path.isdir(i):
              shutil.copytree(i, dest)
          else:
              shutil.copy(i, dest)
  </code></pre>
  
  <p>I have the feeling that the same task can be done in a better and easier manner. How do i do it?</p>