Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does iPython have built-in support for viewing a variable in pager? [duplicate]

Tags:

python

ipython

I often need to view long text variables in iPython. I typically use scroll buffers for this, but I really want a pager with searching. Does iPython have a way to view long variables in a pager (e.g., less)? If not, I can certainly contrive a way to do this with !.

Note: I'm not asking how to set up PAGER generally. ?, ??, %pdoc, etc all work fine with a less. I'm asking specifically for paging variables.

like image 340
Reece Avatar asked Dec 04 '12 00:12

Reece


1 Answers

Answer: %page

Example usage:

snafu$ ipython
In [1]: import httplib2
In [2]: resp,data = httplib2.Http().request('http://google.com')
In [3]: %page data

Answer from How to use Pipe in ipython

like image 130
Reece Avatar answered Sep 21 '22 15:09

Reece