python: subprocess and piped execution of commands

Viewed 10

I'm new to python. I need to run execute via python script a piped command e.g. "ls /my/path | grep ^file" and capture its output.

I've checked documentation about subprocess module, however it has so many arguments, I'm confused: do I need to execute my pipes commands in multiple subprocess.run()?

0 Answers
Related