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

bundles / IPython latest / IPython / core / interactiveshell / InteractiveShell / extract_input_lines

function

IPython.core.interactiveshell:InteractiveShell.extract_input_lines

source: /IPython/core/interactiveshell.py :3971

Signature

def   extract_input_lines ( self range_str raw = False )

Summary

Return as a string a set of input history slices.

Parameters

range_str : str

The set of slices is given as a string, like "~5/6-~4/2 4:8 9", since this function is for use by magic functions which get their arguments as strings. The number before the / is the session number: ~n goes n back from the current session.

If empty string is given, returns history of current session without the last input.

raw : bool, optional

By default, the processed input is used. If this is true, the raw input history is used instead.

Notes

Slices can be described with two notations:

  • N:M -> standard python form, means including items N...(M-1).

  • N-M -> include items N..M (closed endpoint).

Aliases

  • IPython.InteractiveShell.extract_input_lines