I want to simulate the following unix commands:
f=`find . -name "*.pdf"`
for file in $f; do echo "$f"; done
I have the following python command:
out= subprocess.check_output(["/usr/bin/find", ".", "-name", "*.pdf"]).strip()
But I can't access out[0] or out[1] and so on. Is it possible to return the output in python as an array of strings, so I can iterate over each of them and do something with it? Thanks
os.walk()is a thing?os.walk()wouldn't help in that use case.