Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'third-party': 0.04; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'ah,': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'simpson': 0.16; 'wrote:': 0.18; '(but': 0.19; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'cheers,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'though.': 0.31; "we're": 0.32; 'url:python': 0.33; 'subject:with': 0.35; 'c++': 0.36; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'url:library': 0.38; 'quote': 0.39; 'url:3': 0.61; 'content-disposition:inline': 0.62; 'kind': 0.63; 'rebert': 0.84; 'url:quote': 0.84 Date: Sat, 6 Apr 2013 10:53:57 +1100 From: Cameron Simpson To: Chris Rebert Subject: Re: os.system() with imbeded quotes on centos MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) References: Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365206046 news.xs4all.nl 6911 [2001:888:2000:d::a6]:35578 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42864 On 05Apr2013 16:36, Chris Rebert wrote: | No need for third-party code, just use the std lib: | http://docs.python.org/2/library/pipes.html#pipes.quote | http://docs.python.org/3/library/shlex.html#shlex.quote Ah, handy. I must say its quote quoting is kind of verbose, though. | (But yeah, best of all is to just use `subprocess` with shell=False.) Cheers, -- Cameron Simpson Plague, Famine, Pestilence, and C++ stalk the land. We're doomed! Doomed! - Simon E Spero