def move_in_stack(move_up):
 frame = Frame.get_selected_python_frame()
 while frame:
  if move_up:
   iter_frame = frame.older()
  else:
   iter_frame = frame.newer()
  if (not iter_frame):
   break
  if iter_frame.is_python_frame():
   if iter_frame.select():
    iter_frame.print_summary()
   return
  frame = iter_frame
 if move_up:
  print('Unable to find an older python frame')
 else:
  print('Unable to find a newer python frame')

def move_in_stack ( move_up ) : frame = Frame . get_selected_python_frame ( ) while frame : if move_up : iter_frame = frame . older ( ) else : iter_frame = frame . newer ( ) if ( not iter_frame ) : break if iter_frame . is_python_frame ( ) : if iter_frame . select ( ) : iter_frame . print_summary ( ) return frame = iter_frame if move_up : print ( 'Unable to find an older python frame' ) else : print ( 'Unable to find a newer python frame' )
move up or down the stack .