-2

I need a function that lets me copy a folder and what is in the folder into another existing folder. I have tried "shutil.copy", "shutil.copy2" and shutil.copytree" none of these do what I want. I am on python 3.6.2 on windows 10. I am still learning this language so don't make the explanations to complicated.

  • 1
    It might help if you explained what the functions you mentioned lack that you're looking for. – glibdud Jan 26 '18 at 16:43
  • sure, copy 1 and two only copy a specific file. i want to copy the hole folder. copy tree copys the hole directory and I just want one folder and in copy tree one of the directories can not already exist. – Jacob Knuth Jan 26 '18 at 18:33

1 Answers1

0

Here's something:

import os

def copyfolder(folder,newfolder):
    os.system("xcopy \""+folder+"\" \""+newfolder+"\" /h /i /c /k /e /r /y")
Qwerty
  • 1,252
  • 1
  • 11
  • 23