Jupyter / IPython SList :: Obtaining non-tokenized output from the shell execute operator “!”
问题 When shell commands are run within a Jupyter Notebook Python Cell , like this: output = ! some-shell-command each line emitted to the standard output ( stdout ) is captured in a list like IPython data-structure called a SList . For instance: output = !echo -e 'line1\nline2\nline3' print(output) # A IPython SList data-structure. ['line1', 'line2', 'line3'] Sometimes, however, you want to preserve the original string output format, without tokenization into a list, like this: print(output)