I'm trying to work out how many lines of metadata there are until the real data starts, and the defined function below doesn't return the
x value later on.
x not defined outside the function? Is
return x placed wrong?
def find(): data=file('file.dat') x=0 for line in data: if 'metaend' in line: break return x else: x+=1 find()