IPython shell assignment (the !
operator) evaluates a command using the local shell (e.g., bash
) and returns a string list (IPython.utils.text.SList
). An SList
is a list-like object containing "chunks" of stdout and stderr, properties for accessing those chunks in different forms, and convenience methods for operating on them.
![Binder](https://camo.githubusercontent.com/4e66027072f7aa2f6b53bb56e496d94879d3d8c3160145d6db1b1edb55096bd2/68747470733a2f2f6d7962696e6465722e6f72672f62616467652e737667)
The SList.ipynb
notebook below uses SList
properties to access the output of a shell command as a list-like of strings, a newline-separated string, a space-separated string, and a list of pathlib.Path
objects. The notebook then uses the SList.fields()
and SList.grep()
methods to extract columns from and search command output.