So I am using writing this method, which work fine in term of looking up number but it only return last value. is there a way to make it so it return all the values after each run.
here is my code:
def searchPFAM():
fileAddress = '/Volumes/interpro/data/Q14591.txt'
start = None
end = None
with open(fileAddress,'rb') as f:
root = etree.parse(f)
for lcn in root.xpath("/protein/match[@dbname='PFAM']/lcn"):#find dbname =PFAM
start = int(lcn.get("start"))#if it is PFAM then look for start value
end = int(lcn.get("end"))#if it is PFAM then also look for end value
print start, end
return start, end
Do you mean something similar to this?