Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85735
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <David.Aldrich@EMEA.NEC.COM> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.023 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; '"""': 0.07; 'subject:()': 0.09; 'subject:question': 0.10; 'question.': 0.14; 'cmd': 0.16; 'readable': 0.16; 'received:85.115': 0.16; 'received:85.115.54': 0.16; 'received:85.115.54.190': 0.16; 'received:cluster-j.mailcontrol.com': 0.16; 'to:addr:web.de': 0.16; 'command': 0.22; 'to:name:python-list@python.org': 0.22; 'header:Received:8': 0.24; 'header:In-Reply-To:1': 0.27; 'especially': 0.30; 'subject:list': 0.30; 'code': 0.31; 'received:169.254': 0.32; 'skip:s 30': 0.35; 'version': 0.36; 'replies': 0.36; 'thanks': 0.36; 'possible': 0.36; 'received:169': 0.37; 'easily': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'more': 0.64; 'to:2**2': 0.65; 'to:addr:gmail.com': 0.65; 'shell,': 0.91; 'subject:skip:s 20': 0.91 |
| From | David Aldrich <David.Aldrich@EMEA.NEC.COM> |
| To | Amirouche Boubekki <amirouche.boubekki@gmail.com>, Peter Otten <__peter__@web.de>, "python-list@python.org" <python-list@python.org> |
| Subject | RE: A question about a list and subprocess.check_call() |
| Thread-Topic | A question about a list and subprocess.check_call() |
| Thread-Index | AQHQSiBQgNKL333DvkKfebWbX2DURpz0k3Wg |
| Date | Tue, 17 Feb 2015 09:32:03 +0000 |
| References | <CAL7_Mo_okCswN3P0pZvrsU2HiLjBsw4W8Nvqgzxfjuh7Aw-nkw@mail.gmail.com> |
| In-Reply-To | <CAL7_Mo_okCswN3P0pZvrsU2HiLjBsw4W8Nvqgzxfjuh7Aw-nkw@mail.gmail.com> |
| Accept-Language | en-GB, en-US |
| Content-Language | en-US |
| X-MS-Has-Attach | |
| X-MS-TNEF-Correlator | |
| x-originating-ip | [172.29.68.112] |
| Content-Type | text/plain; charset="utf-8" |
| Content-Transfer-Encoding | base64 |
| MIME-Version | 1.0 |
| X-Scanned-By | MailControl 37812.332 (www.mailcontrol.com) on 10.74.0.151 |
| 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 | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18782.1424165529.18130.python-list@python.org> (permalink) |
| Lines | 8 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1424165529 news.xs4all.nl 2855 [2001:888:2000:d::a6]:59015 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:85735 |
Show key headers only | View raw
>It's also possible to do it the other around using shlex.split. I prefer that version because >I can easily copy/paste the command from code to the shell, it's also more readable IMO: > cmd = """python3 -O -c "import sys; print(sys.argv[1:])" foo bar "spam egg" """ > print(cmd) > subprocess.check_call(shlex.split(cmd)) Thanks again for the replies to my question. I especially like the solution of using shlex.split().
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
RE: A question about a list and subprocess.check_call() David Aldrich <David.Aldrich@EMEA.NEC.COM> - 2015-02-17 09:32 +0000
csiph-web