raise IOError("Could not copy file or directory: " + out) code example Example: copy files python from shutil import copyfile copyfile(src, dst)