split_line#

scikitplot._ipymagic.split_line(line)[source]#

Split a magic’s line into arguments the way a POSIX shell would.

Parameters:
linestr

Text after the magic’s name (IPython has already expanded {var} and $var).

Returns:
list of str

Arguments.

Raises:
MagicUsageError

For an unterminated quote.

Parameters:

line (str)

Return type:

list[str]

Notes

Quote a Windows path ("C:\Users\me\env.toml"): outside quotes a backslash escapes the next character, as in any POSIX shell.

Examples

>>> from scikitplot._ipymagic import split_line
>>> split_line('env plan -n "my env" --package six')
['env', 'plan', '-n', 'my env', '--package', 'six']