Input & Output In Binary Mode
If you want to open a file and write binary data to it, you should use the following functions:
- open() to open the file to a file handle.
- binmode() to set the file handle to binary mode.
- print() to write data to the file handle.
- close() to close the file handle.
Note that the print() function can be used in both binary mode and text mode. In binary mode, print() will not convert \n to \r\n in Windows system…

