Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!dedekind.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!reader03.nrc01.news.zen.net.uk.POSTED!not-for-mail From: Nobody Subject: Re: Opinion on best practice... Date: Wed, 06 Feb 2013 03:32:50 +0000 User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.python References: <207d17ce-4bc7-487c-acde-6a7b9f66002b@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lines: 24 Organization: Zen Internet NNTP-Posting-Host: 90927fa5.news.zen.co.uk X-Trace: DXC=4dj_a2Y`K9LgN9e0JNPkjOf2FgniPJjgB=dR0\ckLKG@WeZ<[7LZNRF]o1kC Hooray for common sense! Python is great, but it's silly to use Python > (unless there is good reason) when a simple shell script will do the job. A shell script is only the better option if (almost) the *only* thing the script needs to do is to execute commands. The moment you start trying to "process" data, it's time to put up with the verbosity of subprocess.Popen() so that you can use a well-designed language for the rest of it. Shells are designed first and foremost for interactive use, and everything else is compromised by that fact. Minimising the number of keystrokes is a great idea for something which will be typed, executed and forgotten. It's an awful idea if you're going to modify the script in six months' time. Making the execution of commands a fundamental language feature is a great idea if that's most of what you do, but not such a great idea if you'll be doing a lot else besides (because most of the available syntax has been "consumed" by command execution).