[IPython-user] notes and suggestions
rhh at structurelabs.com
Mon Feb 20 21:39:44 CST 2006
In the online manual the usage for save is listed as
%save filename n1-n2 n3-n4 ... n5 .. n6 ...
where it should be
%save filename n1:n2 n3:n4 ... n5 .. n6 ...
A useful magic function is the clip function, which copies a set of
input lines to the clipboard. To use this on Windows the win32clipboard
module needs to be imported into the Magic.py module and the following
function, based on the magic save function, needs to be added.
def magic_clip(self,parameter_s = ''):
"""Save a set of lines to the clipboard.
%clip n1:n2 n3:n4 ... n5 .. n6 ...
This function uses the same syntax as %macro for line
instead of creating a macro it saves the resulting string to the
args = parameter_s.split()
ranges = args[0:]
cmds = ''.join(self.extract_input_slices(ranges))
print 'The following commands were written to the clipboard'
More information about the IPython-user