Reading and writing of text files

--Originally published at Start in the world of the #TC101

Variables are a fine way to store data while your program is running, but if you want your data to persist even after your program has finished, you need to save it to a file. You can think of a file’s contents as a single string value, potentially gigabytes in size. In this chapter, you will learn how to use Python to create, read, and save files on the hard drive.

In Python, you don’t need to import any library to read and write files.
The first step is to get a file object.
The way to do this is to use the open function.

In this link (http://www.pythonforbeginners.com/files/reading-and-writing-files-in-python) we can have a better explanation about the topic

And here are examples:

http://stackoverflow.com/questions/3925614/how-do-you-read-a-file-into-a-list-in-python