There are times when the standard Python file objects can’t meet your requirements, and you need to use the Windows API to manipulate files. This can happen in a number of situations, such as:
You need to read or write data to or from a Windows pipe.
You need to set custom Windows security on a file you are creating.
You need to perform advanced techniques for performance reasons, such as “Overlapped” operations or using completion ports.
Python file objects are integrated closely with Python. You should
win32file module only when standard Python
file objects can’t meet your requirements. Using the
win32file module is a good deal more complex than
using native Python files.