class_docstr: Editing widget using the interior of a window object.
   Supports the following Emacs-like key bindings:
  
  Ctrl-A      Go to left edge of window.
  Ctrl-B      Cursor left, wrapping to previous line if appropriate.
  Ctrl-D      Delete character under cursor.
  Ctrl-E      Go to right edge (stripspaces off) or end of line (stripspaces on).
  Ctrl-F      Cursor right, wrapping to next line when appropriate.
  Ctrl-G      Terminate, returning the window contents.
  Ctrl-H      Delete character backward.
  Ctrl-J      Terminate if the window is 1 line, otherwise insert newline.
  Ctrl-K      If line is blank, delete it, otherwise clear to end of line.
  Ctrl-L      Refresh screen.
  Ctrl-N      Cursor down; move down one line.
  Ctrl-O      Insert a blank line at cursor location.
  Ctrl-P      Cursor up; move up one line.
  
  Move operations do nothing if the cursor is at an edge where the movement
  is not possible.  The following synonyms are supported where possible:
  
  KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N
  KEY_BACKSPACE = Ctrl-h
class_docstr_tok: ["Editing","widget","using","the","interior","of","a","window","object",".","Supports","the","following","Emacs-like","key","bindings",":","Ctrl-A","Go","to","left","edge","of","window",".","Ctrl-B","Cursor","left",",","wrapping","to","previous","line","if","appropriate",".","Ctrl-D","Delete","character","under","cursor",".","Ctrl-E","Go","to","right","edge","(","stripspaces","off",")","or","end","of","line","(","stripspaces","on",")",".","Ctrl-F","Cursor","right",",","wrapping","to","next","line","when","appropriate",".","Ctrl-G","Terminate",",","returning","the","window","contents",".","Ctrl-H","Delete","character","backward",".","Ctrl-J","Terminate","if","the","window","is","1","line",",","otherwise","insert","newline",".","Ctrl-K","If","line","is","blank",",","delete","it",",","otherwise","clear","to","end","of","line",".","Ctrl-L","Refresh","screen",".","Ctrl-N","Cursor","down",";","move","down","one","line",".","Ctrl-O","Insert","a","blank","line","at","cursor","location",".","Ctrl-P","Cursor","up",";","move","up","one","line",".","Move","operations","do","nothing","if","the","cursor","is","at","an","edge","where","the","movement","is","not","possible",".","The","following","synonyms","are","supported","where","possible",":","KEY_LEFT","=","Ctrl-B",",","KEY_RIGHT","=","Ctrl-F",",","KEY_UP","=","Ctrl-P",",","KEY_DOWN","=","Ctrl-N","KEY_BACKSPACE","=","Ctrl-h"]
docstr: Go to the location of the first blank on the given line,
  returning the index of the last non-blank character.
docstr_tok: ["Go","to","the","location","of","the","first","blank","on","the","given","line",",","returning","the","index","of","the","last","non-blank","character","."]
code: def _end_of_line(self, y):
      """Go to the location of the first blank on the given line,
      returning the index of the last non-blank character."""
      self._update_max_yx()
      last = self.maxx
      while True:
          if (
              curses.ascii.ascii(self.win.inch(y, last))
              != curses.ascii.SP
          ):
              last = min(self.maxx, last + 1)
              break
          elif last == 0:
              break
          last = last - 1
      return last
  
file_path: cpython/Lib/curses/textpad.py
imports: import curses
  import curses.ascii
label_desc: Use image node_id 3 for calling the Textbox obj's underlying member method code with example usage: obj._end_of_line(y) and returns: last