[IPython-dev] Two basic Notebook questions (Python focus)

Matthias Bussonnier 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. 

try --InteractiveShell.display_page=True

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?

No, 

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. 
-- 
M

> 
> Thanks,
> 
> JBB
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150130/b4f16ff5/attachment.html>


More information about the IPython-dev mailing list