I would like to move in python files and directories in one directory to another directory with overwrite ability.
I started with the following code:
This because os.listdir(path) return array according documentation here. So you should modify you code as following for moving files and directories.
#moving files from progs
path = tempfolder + 'progs/'
for item_path in os.listdir(path):
shutil.move(os.path.join(path, item_path) , os.path.join(compteurfolder, item_path)