Badly need assistance on this:
f = open('/Volumes/Personal/example.text','r+')
for line in f:
print(line, end='')
if (line.startswith("path = ")) in f:
line = CurrentFilePath + "\n"
f.write(line)
print ("Success!!!!")
else:
print('Errorrrr!!!')
this line of code just reads the file, and as soon as the line which needs to be read and then replaced, it throws an error! Please help. Very very new to python.