shutil.copyfileobj() method in Python is used to copy the contents of a file object to another file object. By default, this method copies data in chunks, and if desired, we can also specify the size of the buffer through the length parameter.
This method copies the contents of the file from the current file position to the end of the file.
Syntax: shutil.copyfileobj (fsrc, fdst [, length])
fsrc: A file-like object representing the source file to be copied
fdst: A file-like object representing the destination file, where fsrc will be copied.
length (optional): An integer value denoting buffer size.
File-like object are mainly StringIO objects, connected sockets and actual file objects.
Return Type: This method does not return any value.
Code: using method
shutil.copyfileobj () em > to copy the contents of the source file object to the target file object