def get_window_contents(): """Dump the contents of the current curses window.""" tbox = curses.textpad.Textbox(window) tbox.stripspaces = False; w_str = tbox.gather() return w_str