Indeed if line = f.readline then line.split(delimiter) does not work, because in this case line is not a string but a method, so you cannot call split on it.
You meant line = f.readline().