[IPython-dev] Smart copy rocks, let's make it even better :)

Evan Patterson epatters@enthought....
Tue Sep 7 19:19:54 CDT 2010


On Tue, Sep 7, 2010 at 4:46 PM, Fernando Perez <fperez.net@gmail.com> wrote:
> Hey Evan,
>
> I'm loving smart copy, but I was thinking it would be even better to
> strip not just prompts, but all output, so that one can just highlight
> a bunch of prior input, C-C, C-V and then edit it as a new multiline
> cell without having to clean out output.
>
> We could then leave C-Shift-C or a menu entry for 'full copy' that
> would not do any stripping, for copy/pasting full sessions into an
> external document, for example.

This sounds reasonable, and it would not take much effort to implement
this. I'll put it on the list.

>
> With that improvement, the workflow begins to feel really fantastic,
> since it's possible to do things like:
>
> In [29]: f = qt.QFont('Consolas')
>
> In [30]: fi = qt.QFontInfo(f)
>
> In [31]: fi.family()
> Out[31]: PyQt4.QtCore.QString(u'Consolas')
>
> < Copy-paste here of the previous three lines, now I have a single
> block I can easily modify and re-execute>
>
> In [32]: f = qt.QFont('Consolas')
>    ...: fi = qt.QFontInfo(f)
>    ...: fi.family()
> Out[32]: PyQt4.QtCore.QString(u'Consolas')
>
> <re-execute changing one parameter>
>
> In [33]: f = qt.QFont('Consolata')
>    ...: fi = qt.QFontInfo(f)
>    ...: fi.family()
> Out[33]: PyQt4.QtCore.QString(u'DejaVu Sans')
>
>
Since you're playing with Consolas, I should note parenthetically that
I have made this the default font on Windows (when it is available).

> Since I made the run_cell semantics analyze the input and run the
> *last* statement in single mode, you get the benefits of a cell-based
> system with the fluidity of a console :)
>
> Cheers,
>
> ps - that and the up-arrow-filter-matches, and we'll be in heaven :)

I'm actually working on this feature right now. It will probably be
checked in sometime tomorrow morning.

Evan


More information about the IPython-dev mailing list