Running this code produces a nameError saying ret is not defined. Why does the ret work in the if action == 'state' block but not in the elif action == list block?
if action == 'stat':
ret = pp.stat()
print ret
sys.exit()
elif action == 'list':
for i in range(1, ret[0]+1):
mlist = pp.top(i, 0)
print 'line: ', len(mlist[1])
ret = pp.list()
print ret
if action == 'stat'is false thenretnever gets definedso when the elif is executed then ret is never defined