On 19.05.2015 19:01, Cecil Westerhof wrote: > At the moment I am playing with things like: > p = subprocess.Popen('ls -l', shell = True, stdout = subprocess.PIPE) > > I think that most of the times this are the values I want. So it would > be nice to overrule the defaults. What is the best way to do this?
I would like to answer with a counter-question: Why do you want to do this? What is the reason to use ls -l if you could also be using os.listdir() or os.scandir()? There are some reasons against screenscraping `ls` (locale-specifities and environment variable dependencies of ls) and using shell=True (with shells being huge complex beasts which may have unexpected security issues, see Shellshock), so I’m not sure why you would want to do that. regards, jwi
signature.asc
Description: OpenPGP digital signature
-- https://mail.python.org/mailman/listinfo/python-list