shutil.copytree without files

前端 未结 5 2091
刺人心
刺人心 2021-02-13 19:39

I\'m trying use shutil.copytree:

shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=None)

This copy also files in folder. I need copy only folders

5条回答
  •  隐瞒了意图╮
    2021-02-13 20:02

    You should consider using os.walk.

    Here is an example for os.walk. This way you could list all the directories and then create them with os.mkdir.

提交回复
热议问题