{ } Raw JSON

bundles / IPython 9.17.0 / IPython / core / interactiveshell / InteractiveShell / define_macro

function

IPython.core.interactiveshell:InteractiveShell.define_macro

source: /dev/ipython/IPython/core/interactiveshell.py:2677

Signature

def define_macro(self, name, themacro)

Summary

Define a new macro

Parameters

name : str

The name of the macro.

themacro : str or Macro

The action to do upon invoking the macro. If a string, a new Macro object is created by passing the string to it.

Aliases

  • IPython.InteractiveShell.define_macro