[IPython-dev] IPython (new) + matplotlib report: happy news

John Hunter jdh2358@gmail....
Tue Sep 14 10:21:20 CDT 2010


On Mon, Sep 13, 2010 at 4:10 PM, Brian Granger <ellisonbg@gmail.com> wrote:

>> One small request: is it possible/easy to add to the MPL examples a
>> little 'copy to clipboard' button or link?  Now that one can
>> copy/paste wholesale examples into an interactive session to explore
>> them, it feels annoying to have to highlight the whole text box and
>> then do Ctrl-C or menu->copy.  It would be really nice to have a
>> one-click 'copy to clipboard'...  But I have no idea if that's easy or
>> hard in HTML...
>
> +1 to this!

On a quick googling, there are some IE only Javascript examples to do
this.  Apparently you can enable them in firefox but it requires a
significant amount of about:config hackery
(http://www.febooti.com/support/website-help/website-javascript-copy-clipboard.html).

How about this as an alternative: on my box, I can drag the "source
code" link from the browser into my terminal, which by default pastes
the URL of the referenced *.py into the terminal.  If "run" supported
a -w (web) option, or automatically detected that the URL starts with
http, it could do a web run of the file.  Of course, you may want the
source code pasted in for illustrative purposes... To support this,
you could add a -u (url) option to "paste" which assumes the input is
a url, fetches it, and pastes the contents into ipython.  So you could
type "paste -u" and then drag the link into the terminal, and it would
fetch it and paste the code into an input block.

JDH


More information about the IPython-dev mailing list