メインメソッドに開始値と終了値を保存する方法はありますか? これを試してみましたが、エラーが発生しました:
def searchM():
fileAddress = '/database/pro/data/'+ID+'.txt'
with open(fileAddress,'rb') as f:
root = etree.parse(f)
for lcn in root.xpath("/protein/match[@dbname='M']/lcn")
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
return "%s, %s" % (start, end,)
values = searchM()
(start, end,) = values
エラー メッセージは UnboundLocalError: local variable 'start' referenced before assigning です。