Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!newsfeed.pionier.net.pl!feed.xsnews.nl!border03.ams.xsnews.nl!feeder03.ams.xsnews.nl!abp001.ams.xsnews.nl!frontend-F10-11.ams.news.kpn.nl From: Cecil Westerhof Newsgroups: comp.lang.python Subject: Best way to rewrite Popen Organization: Decebal Computing X-Face: "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR,v+Pti8=Vi/Z"g^?b"E X-Homepage: http://www.decebal.nl/ Date: Tue, 19 May 2015 19:01:05 +0200 Message-ID: <87siastsby.fsf@Equus.decebal.nl> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:KknlVhI7sXjX+PzLtCez+79Tx+g= MIME-Version: 1.0 Content-Type: text/plain Lines: 19 NNTP-Posting-Host: 81.207.62.244 X-Trace: 1432055726 news.kpn.nl 20632 81.207.62.244@kpn/81.207.62.244:34590 Xref: csiph.com comp.lang.python:90876 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? So creating a function that is exactly the same except for the defaults for shell and stdout (and maybe stderr). It is a little less important as I first thought, because I found the following: error, output = subprocess.getstatusoutput('ls -1') files_new = output.splitlines() But it is still nice to know. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof