:mod:`sc3nb.magics` =================== .. py:module:: sc3nb.magics .. autoapi-nested-parse:: This module adds the Jupyter specialties such as Magics and Keyboard Shortcuts .. !! processed by numpydoc !! Module Contents --------------- Function List ~~~~~~~~~~~~~ .. autoapisummary:: :nosignatures: sc3nb.magics.load_ipython_extension sc3nb.magics.add_shortcut Class List ~~~~~~~~~~ .. autoapisummary:: :nosignatures: sc3nb.magics.SC3Magics Content ~~~~~~~ .. py:function:: load_ipython_extension(ipython) -> None Function that is called when Jupyter loads this as extension (%load_ext sc3nb) :Parameters: **ipython** : IPython IPython object .. !! processed by numpydoc !! .. py:function:: add_shortcut(ipython, shortcut: str = None) -> None Add the server 'free all' shortcut. :Parameters: **ipython** : IPython IPython object **shortcut** : str, optional shortcut for 'free all', by default it is "cmd-." or "Ctrl-." .. !! processed by numpydoc !! .. class:: SC3Magics(shell=None, **kwargs) **Bases:** :class:`IPython.core.magic.Magics` IPython magics for SC class Create a configurable given a config config. :Parameters: **config** : Config If this is empty, default values are used. If config is a :class:`Config` instance, it will be used to configure the instance. **parent** : Configurable instance, optional The parent Configurable instance of this object. .. rubric:: Notes Subclasses of Configurable must call the :meth:`__init__` method of :class:`Configurable` *before* doing anything else and using :func:`super`:: class MyConfigurable(Configurable): def __init__(self, config=None): super(MyConfigurable, self).__init__(config=config) # Then any other code you need to finish initialization. This ensures that instances will be configured properly. .. !! processed by numpydoc !! **Overview:** .. autoapisummary:: :nosignatures: sc3nb.magics.SC3Magics.sc sc3nb.magics.SC3Magics.scv sc3nb.magics.SC3Magics.scs sc3nb.magics.SC3Magics.scg sc3nb.magics.SC3Magics.scgv sc3nb.magics.SC3Magics.scgs sc3nb.magics.SC3Magics._parse_pyvars .. py:method:: sc(line='', cell=None) Execute SuperCollider code via magic :Parameters: **line** : str, optional Line of SuperCollider code, by default '' **cell** : str, optional Cell of SuperCollider code , by default None :Returns: Unknown cmd result .. !! processed by numpydoc !! .. py:method:: scv(line='', cell=None) Execute SuperCollider code with verbose output :Parameters: **line** : str, optional Line of SuperCollider code, by default '' **cell** : str, optional Cell of SuperCollider code , by default None :Returns: Unknown cmd result .. !! processed by numpydoc !! .. py:method:: scs(line='', cell=None) Execute SuperCollider code silently (verbose==False) :Parameters: **line** : str, optional Line of SuperCollider code, by default '' **cell** : str, optional Cell of SuperCollider code , by default None :Returns: Unknown cmd result .. !! processed by numpydoc !! .. py:method:: scg(line='', cell=None) Execute SuperCollider code returning output :Parameters: **line** : str, optional Line of SuperCollider code, by default '' **cell** : str, optional Cell of SuperCollider code , by default None :Returns: Unknown cmd result Output from SuperCollider code, not all SC types supported, see pythonosc.osc_message.Message for list of supported types .. !! processed by numpydoc !! .. py:method:: scgv(line='', cell=None) Execute SuperCollider code returning output :Parameters: **line** : str, optional Line of SuperCollider code, by default '' **cell** : str, optional Cell of SuperCollider code , by default None :Returns: Unknown cmd result Output from SuperCollider code, not all SC types supported, see pythonosc.osc_message.Message for list of supported types .. !! processed by numpydoc !! .. py:method:: scgs(line='', cell=None) Execute SuperCollider code returning output :Parameters: **line** : str, optional Line of SuperCollider code, by default '' **cell** : str, optional Cell of SuperCollider code , by default None :Returns: Unknown cmd result Output from SuperCollider code, not all SC types supported, see pythonosc.osc_message.Message for list of supported types .. !! processed by numpydoc !! .. py:method:: _parse_pyvars(code: str) -> Dict[str, Any] Parses SuperCollider code for python variables and their values :Parameters: **code** : str SuperCollider code snippet :Returns: Dict[str, Any] Dict with variable names and their values. :Raises: NameError If pyvar injection value can't be found. .. !! processed by numpydoc !!