You are viewing an older version (9.3.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.3.0 / IPython / core / magics / script / ScriptMagics / shebang

function

IPython.core.magics.script:ScriptMagics.shebang

source: /IPython/core/magics/script.py :172

Signature

def   shebang ( self line cell )

Summary

::

Extended Summary

%shebang [--no-raise-error] [--proc PROC] [--bg] [--err ERR] [--out OUT]

Run a cell via a shell command

The %%script line is like the #! line of script, specifying a program (bash, perl, ruby, etc.) with which to run.

The rest of the cell is run by that program.

Examples

:: In [1]: %%script bash ...: for i in 1 2 3; do ...: echo $i ...: done 1 2 3 options: --no-raise-error Whether you should raise an error message in addition to a stream on stderr if you get a nonzero exit code. --proc PROC The variable in which to store Popen instance. This is used only when --bg option is given. --bg Whether to run the script in the background. If given, the only way to see the output of the command is with --out/err. --err ERR The variable in which to store stderr from the script. If the script is backgrounded, this will be the stderr *pipe*, instead of the stderr text itself and will not be autoclosed. --out OUT The variable in which to store stdout from the script. If the script is backgrounded, this will be the stdout *pipe*, instead of the stderr text itself and will not be auto closed.

Aliases

  • IPython.core.magics.ScriptMagics.shebang