私が開発して動作したスクリプトが/var/tmp
ありました...何らかの理由で必要なディレクトリに移動すると、次のエラーが返されます。
Traceback (most recent call last):
File "tail.py", line 104, in <module>
test=isItAlive(line)
File "tail.py", line 55, in isItAlive
return test
UnboundLocalError: local variable 'test' referenced before assignment
それがうめき声を上げている機能は次のとおりです。
def isItAlive(text):
with open(valcsv) as f:
searches = [x.split(',')[1] for x in f.read().splitlines()]
for search in searches:
# print search
if not search in text:
test="TOBEADDED"
else:
test=search
break
return test
f.close()