import os
dir_path = os.path.dirname(os.path.realpath(__file__))
import os
print('File name : ', os.path.basename(__file__))
print('Directory Name: ', os.path.dirname(__file__))
from os import path
dir_path = path.dirname(__file__)
from pathlib import Path
import shutil
tmp = Path("/tmp")
src = tmp.joinpath("src")
src.mkdir()
src.joinpath("src.txt").touch()
# /tmp/src
# /tmp/src/src.txt
dst = tmp.joinpath("dst")
dst.mkdir()
# /tmp/dst
shutil.copytree(src, dst)
# FileExistsError: [Errno 17] File exists: '/tmp/dst'
shutil.copytree(src, dst, dirs_exist_ok=True)
# PosixPath('/tmp/dst')