4 ms·
It's not hard, just too much noise. from subprocess import run run("ls -la".split()) This is what I do to reduce noise
by tomthehero 7y ago
It's not hard, just too much noise.
from subprocess import run
run("ls -la".split())
This is what I do to reduce noise
- mindcrime 7y agoTry Groovy: $groovy -e ' println "ls -l /".execute().text' Without the "run the example on the command line" baggage, it reduces to: println "ls -l".execute().text assuming you just want to spit out the results. What's nice about this is that it's ultimately just syntactic sugar over the standard Java ProcessBuilder / Process mechanism, and it's relatively easy to support more advanced cases like defining your own input, output, and error streams for the underlying process, etc.