[IPython-dev] Two basic Notebook questions (Python focus)
bussonniermatthias at gmail.com
Fri Jan 30 05:28:58 EST 2015
Le 29 janv. 2015 à 18:28, Jean Bigboute <jeanbigboute at gmail.com> a écrit :
> 1) I often go back and forth in cells, tweaking functions. I'd like to be able to show the current code for a function in a cell (not the pager) when I'm not sure which function definition I last executed
> %psource function
> works nicely but the result goes in the pager, not the cell.
> These two options work but require remembering things which gets tricky when I use different computers:
> import inspect
> print inspect.getsource(function)
> and the pager redefinition shown in
> http://nbviewer.ipython.org/gist/minrk/7715212 has a fix which requires imports
> I am sure there must be a way to do this and I just haven't searched on the correct terms...
In IPython master there is an option to redirect all pager things to output.
The plan it to make output detachable.
see PR 7009.
> 2) Is it possible to paste images from the clipboard buffer into a cell without first creating a separate image file and then linking to that file?
I would suggest looking at github.com/IPython-contrib for an extension to do that.
There are some complication to do that though, in particular when "uploading" do you want to upload
to server or kernel ?
Now that we have content API it should be easier to implement if it is not yet done.
> IPython-dev mailing list
> IPython-dev at scipy.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev