Return as a string a set of input history slices. Parameters ---------- range_str : string 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 strin
(self, range_str, raw=False)
| 3638 | page.page(IPython.core.usage.interactive_usage) |
| 3639 | |
| 3640 | def extract_input_lines(self, range_str, raw=False): |
| 3641 | """Return as a string a set of input history slices. |
| 3642 | |
| 3643 | Parameters |
| 3644 | ---------- |
| 3645 | range_str : string |
| 3646 | The set of slices is given as a string, like "~5/6-~4/2 4:8 9", |
| 3647 | since this function is for use by magic functions which get their |
| 3648 | arguments as strings. The number before the / is the session |
| 3649 | number: ~n goes n back from the current session. |
| 3650 | |
| 3651 | raw : bool, optional |
| 3652 | By default, the processed input is used. If this is true, the raw |
| 3653 | input history is used instead. |
| 3654 | |
| 3655 | Notes |
| 3656 | ----- |
| 3657 | |
| 3658 | Slices can be described with two notations: |
| 3659 | |
| 3660 | * ``N:M`` -> standard python form, means including items N...(M-1). |
| 3661 | * ``N-M`` -> include items N..M (closed endpoint). |
| 3662 | """ |
| 3663 | lines = self.history_manager.get_range_by_str(range_str, raw=raw) |
| 3664 | return "\n".join(x for _, _, x in lines) |
| 3665 | |
| 3666 | def find_user_code(self, target, raw=True, py_only=False, skip_encoding_cookie=True, search_ns=False): |
| 3667 | """Get a code string from history, file, url, or a string or macro. |
no test coverage detected