--Originally published at Py(t)hon
Computers can also read and write, for them to do so we have to first create a .txt file and we do this by typing file = open(“file name”, “action”).
The next thing that we can do are the next ones:
- “w” this is use to write in a .txt file
- “r” this is use to read
- “a” open the file for apending
Here is an example:
That’s all #Pug#ISC#Tec#NoMore#Python#TextFiles
![](https://pixel.wp.com/b.gif?host=a01228858.wordpress.com&blog=115152340&%23038;post=319&%23038;subd=a01228858&%23038;ref=&%23038;feed=1)