def last_focused_window():
 try:
  return get('last-focused-main-window')
 except KeyError:
  return window_by_index((-1))

def last_focused_window ( ) : try : return get ( 'last-focused-main-window' ) except KeyError : return window_by_index ( ( - 1 ) )
get the last focused window .