0

I have tried it in Jetbrains Pycharm but it is showing an error.

Here is my code

from datetime import datetime
import os
import shutil
now = datetime.now()
dt=now.strftime("%d%m%Y %H%M%S")
os.mkdir(dt)
shutil.copytree(r"C:\Users\Computer\PycharmProjects\06\08",r"C:\Users\Computer\PycharmProjects\Filecopy\dt")

1 Answers1

1

If you are trying to use the path of your newly-created directory, the line should do:

..., r"C:\Users\Computer\PycharmProjects\Filecopy\{}".format(dt))
SpiderPig1297
  • 305
  • 1
  • 8