TXT format
One of the simplest and common formats for storing data is the TXT format; many IoT sensors log sensor readings with different timestamps in the simple .txt
file format. Python provides built-in functions for creating, reading, and writing into TXT files.Â
 We can access TXT files in Python itself without using any module; the data, in this case, is of the string type, and you will need to transform it to other types to use it. Alternatively, we can use NumPy or pandas.
Â
Using TXT files in Python
Python has built-in functions that read and write into TXT files. The complete functionality is provided using four sets of functions:Â open()
, read()
, write()
, and close()
. As the names suggest, they are used to open a file, read from a file, write into a file, and finally close it. If you are dealing with string data (text), this is the best choice. In this section, we will use Shakespeare
 plays in TXT form; the file can be downloaded from the MIT site: https://ocw.mit.edu/ans7870/6/6.006...