Dec-20-2019, 05:14 PM
So when I run this, I get "TypeError: bad operand type for unary +: 'str'"
import os import shutil src = os.path.expanduser('~/Downloads') print(src) os.getcwd() dst = os.getcwd print(dst) for root, dirs, files in os.walk(src): for file in files: if file.endswith(('.txt', '.md')): print(os.path.join(root,file)) shutil.copyfile(dst, +file)