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

Method page

IPython/core/magics/basic.py:284–310  ·  view source on GitHub ↗

Pretty print the object and display it through a pager. %page [options] OBJECT If no object is given, use _ (last output). Options: -r: page str(object), don't pretty-print it.

(self, parameter_s='')

Source from the content-addressed store, hash-verified

282
283 @line_magic
284 def page(self, parameter_s=''):
285 """Pretty print the object and display it through a pager.
286
287 %page [options] OBJECT
288
289 If no object is given, use _ (last output).
290
291 Options:
292
293 -r: page str(object), don't pretty-print it."""
294
295 # After a function contributed by Olivier Aubert, slightly modified.
296
297 # Process options/args
298 opts, args = self.parse_options(parameter_s, 'r')
299 raw = 'r' in opts
300
301 oname = args and args or '_'
302 info = self.shell._ofind(oname)
303 if info.found:
304 if raw:
305 txt = str(info.obj)
306 else:
307 txt = pformat(info.obj)
308 page.page(txt)
309 else:
310 print('Object `%s` not found' % oname)
311
312 @line_magic
313 def pprint(self, parameter_s=''):

Callers 11

show_usageMethod · 0.80
pdocMethod · 0.80
psourceMethod · 0.80
pfileMethod · 0.80
pinfoMethod · 0.80
psearchMethod · 0.80
_run_with_profilerMethod · 0.80
pfileMethod · 0.80
magicMethod · 0.80
quickrefMethod · 0.80
pycatMethod · 0.80

Calls 2

parse_optionsMethod · 0.80
_ofindMethod · 0.80

Tested by

no test coverage detected