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

Fernando Perez fperez.net at gmail.com
Tue Sep 7 19:46:19 EDT 2010


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.

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 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 :)



More information about the IPython-dev mailing list