O'Reilly logo

Python Programming On Win32 by Mark Hammond, Andy Robinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Native File Manipulation: The win32file Module

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.

Tip

Python file objects are integrated closely with Python. You should use the 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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required