I have to read a line from a file do some computation and write to another file. I have done something like this
fd= open("abc.txt","w")
for line in open("test.txt","r"):
Do something Here
fd.write(modifiedline)
I have usually used with open and for open for line by line operations. Is the above way which I am using ok to use or is there a better way where we use for open and with open together.
I am a student and wish to know more. Any help is appreciated.