Python File Handling
Python File Handling
Modes:
2. Reading a File
file.close()
file.close()
file.close()
3. Writing to a File
file.close()
file.close()
4. Appending to a File
file.close()
file.close()
Summary
• Read: read(), readline(), readlines()
• Write: write(), writelines()
• Use with for auto file closing (recommended but not required).