what can python do with a txt file code example
Example 1: how to veiw and edit files with python
#write
f = open('helloworld.txt','wb')
f.write('hello world')
f.close()
#read
f = open('helloworld.txt','r')
message = f.read()
print(message)
f.close()
Example 2: python output to text file
$ python my_program.py > output.txt