MCPcopy Index your code
hub / github.com/ipython/ipython / page

Function page

IPython/core/page.py:242–265  ·  view source on GitHub ↗

Display content in a pager, piping through a pager after a certain length. data can be a mime-bundle dict, supplying multiple representations, keyed by mime-type, or text. Pager is dispatched via the `show_in_pager` IPython hook. If no hook is registered, `pager_page` will be used.

(data, start: int = 0, screen_lines: int = 0, pager_cmd=None)

Source from the content-addressed store, hash-verified

240
241
242def page(data, start: int = 0, screen_lines: int = 0, pager_cmd=None):
243 """Display content in a pager, piping through a pager after a certain length.
244
245 data can be a mime-bundle dict, supplying multiple representations,
246 keyed by mime-type, or text.
247
248 Pager is dispatched via the `show_in_pager` IPython hook.
249 If no hook is registered, `pager_page` will be used.
250 """
251 # Some routines may auto-compute start offsets incorrectly and pass a
252 # negative value. Offset to 0 for robustness.
253 start = max(0, start)
254
255 # first, try the hook
256 ip = get_ipython()
257 if ip:
258 try:
259 ip.hooks.show_in_pager(data, start=start, screen_lines=screen_lines)
260 return
261 except TryNext:
262 pass
263
264 # fallback on default pager
265 return pager_page(data, start, screen_lines, pager_cmd)
266
267
268def page_file(fname, start=0, pager_cmd=None):

Callers 1

page_fileFunction · 0.70

Calls 2

get_ipythonFunction · 0.90
pager_pageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…