This is a development version (9.15.0.dev) and may be unstable.Go to latest (9.17.0)
{ } Raw JSON

bundles / IPython 9.15.0.dev / IPython / core / magics / code / extract_code_ranges

function

IPython.core.magics.code:extract_code_ranges

source: /dev/ipython/IPython/core/magics/code.py:57

Signature

def extract_code_ranges(ranges_str)

Summary

Turn a string of range for %%load into 2-tuples of (start, stop) ready to use as a slice of the content split by lines.

Examples

list(extract_input_ranges("5-10 2")) [(4, 10), (1, 2)]

Aliases

  • IPython.core.magics.code.extract_code_ranges