Skip to content

Instantly share code, notes, and snippets.

@writetomaha
writetomaha / FileHandling
Created March 14, 2018 09:26
File Handling in Python
Storing, reading, working with files of an operating system
Types of File modes available
'r' : reading mode, this is the default mode which allows you to read the file not any modifications to the file.
'w': writing mode, this can be used for creating the new file as well.
'a': append mode, this is used to write the data to the end of the file, it does not clears any existing data.
#read(): read the contents from a text file
Storing, reading, working with files of an operating system
Types of File modes available
'r' : reading mode, this is the default mode which allows you to read the file not any modifications to the file.
'w': writing mode, this can be used for creating the new file as well.
'a': append mode, this is used to write the data to the end of the file, it does not clears any existing data.
#read(): read the contents from a text file