I want to run the following bash command in Python 3:
ls -l
I know that I can do the following:
from subprocess import call
call(['ls', '-l'])
How do I save this output to a file, or put it into lists or sets?
[-rw-r--r--] [1] [name] [staff] [426] [14 Jan 21:52] [HelloWorld.class]
[-rw-r--r--@] [1] [name] [staff] [107] [14 Jan 21:51] [HelloWorld.java]
...
etc.
I want to be able to access particular information directly, and then add it to the set, but I do not know how many items will be listed.
Any hints, snippets, or examples would really help.
os
library: documentation. – Hildahildagard