reading and writing file in python secure code example
Example 1: python open and reacd file
with open('yourfile.txt','r') as f:
lines = f.readlines()
f.close()
Example 2: read and write to file python
file = open(“testfile.txt”, “r+”)
with open('yourfile.txt','r') as f:
lines = f.readlines()
f.close()
file = open(“testfile.txt”, “r+”)