MCPcopy Create free account
hub / github.com/ipython/ipython / page

Method page

IPython/core/magics/basic.py:279–302  ·  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

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