how to write python file code example
Example 1: open text file in python
f=open("Diabetes.txt",'r')
f.read()
Example 2: python write
with open(filename,"w") as f:
f.write('Hello World')
f=open("Diabetes.txt",'r')
f.read()
with open(filename,"w") as f:
f.write('Hello World')