Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42864

Re: os.system() with imbeded quotes on centos

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 <cameron@cskk.homeip.net>
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 <cs@zip.com.au>
To Chris Rebert <clp2@rebertia.com>
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 <CAMZYqRTkNYpD3jvx+xNsG4x2oHA7fzxbun-W112tRthAiNZ-eg@mail.gmail.com>
User-Agent Mutt/1.5.21 (2010-09-15)
References <CAMZYqRTkNYpD3jvx+xNsG4x2oHA7fzxbun-W112tRthAiNZ-eg@mail.gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.169.1365206046.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


On 05Apr2013 16:36, Chris Rebert <clp2@rebertia.com> 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 <cs@zip.com.au>

Plague, Famine, Pestilence, and C++ stalk the land. We're doomed! Doomed!
        - Simon E Spero

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: os.system() with imbeded quotes on centos Cameron Simpson <cs@zip.com.au> - 2013-04-06 10:53 +1100

csiph-web