Binary File Notes - File Handling
Binary File Notes - File Handling
Computer Science
Binary File:
The following are the basic operations that can be performed on a binary
file:
Open:
The file can be opened using the open() function. The open() function
takes two arguments: the name of the file and the mode in which the file
will be opened. The mode can be one of the following:
Close:
The file can be closed using the close() function. The close() function
flushes any buffered data to the file and releases any resources that are
associated with the file.
Lovejeet Arora
TECHQueenUnacademy
Examples
Lovejeet Arora
TECHQueenUnacademy
The following are some examples of how to perform the basic operations
on a binary file:
Python
# Create an object
my_object = {"name": "John Doe", "age": 30}
Lovejeet Arora
TECHQueenUnacademy
Lovejeet Arora