I'd like to rename %paste to something like %pp so that it takes fewer keystrokes. I worked out a way to do that but it seems complicated. Is there a better way?
def foo(self, bar):
get_ipython().magic("paste")
get_ipython().define_magic('pp', foo)
From IPython 0.13, there's a new %alias_magic magic function, which you would use as:
%alias_magic pp paste
use %alias magic to do it (if you want it to be permanent use %store):
In [8]: %alias??
"""Define an alias for a system command.
'%alias alias_name cmd' defines 'alias_name' as an alias for 'cmd'
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With