Reading and writing files in Python is something that every Python programmer will do at some point. In this video, I will teach you how to work with Python file objects by going through five example scripts that use the open function and the read and write methods on the file objects returned by the open function.

The first example will count the number of words in a file. The second example will format a text file. The third will combine multiple text files into one. The fourth example will show you how to back up binary files. And the final example will demonstrate how to save and restore a working directory in a similar way to git.

0:00​ Intro
1:00​ Count Words
6:13​ Format Files

11:25​ Combine Files
16:53​ Backup Files
23:54​ Save and Restore Files
50:28​ Outro

Get the code here: https://prettyprinted.com/l/xPy​

Subscribe: https://www.youtube.com/channel/UC-QDfvrRIDB6F0bIO4I4HkQ

#python

Python File Objects - How to Read & Write Files With 5 Examples
13.90 GEEK