Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65213
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <meltingwax@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.024 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; 'sys': 0.07; '%s"': 0.09; 'bash': 0.09; 'variables.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'sat,': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'trying': 0.19; 'file,': 0.19; 'feb': 0.22; 'import': 0.22; 'email addr:gmail.com>': 0.22; 'shell': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'script': 0.25; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'especially': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; '(on': 0.31; 'pipe': 0.31; 'file': 0.32; 'url:python': 0.33; 'could': 0.34; 'subject:with': 0.35; 'skip:s 30': 0.35; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'half': 0.37; 'url:library': 0.38; 'called': 0.40; 'url:mail': 0.40; 'how': 0.40; 'read': 0.60; 'save': 0.62; 'show': 0.63; 'to:addr:gmail.com': 0.65; 'day': 0.76; 'fail.': 0.84; 'piping': 0.84; 'rick': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7dKLYI5ZKLSksr9dSnZ428XYxuTwhtKIXLYiy0px1TU=; b=MOjfZ5mYmTBETZ8OVYFnpX/sUmFzUbzR+0UvbZAffDX3nv/PcnvXkZZe0zxLgIMBwP q+SExVzF0oHmzd7/Aq3t1HE77WYkdPVPc30qvJIV8AFzQOIVooVdDCnMRfp0LLtkSnIE /IofO7wkgrq8t1Fd+671w5snO+NUlGR++veMMtBrfHfPUEFlDIkpKc7/KatKLuTvoXW1 hx9YpvuI7DbKl7wFO7UtsLG9rXmlKFKMLWN/t/Y0oepiT3vzAA/YjIKwvekQ/oJMMNLD 7OdCmPoJxgELZxMq6HKMu8lgykfyUnbSLbr7ASVn58vYJpheeDMCipfzbwYouyznN/sH KQdg== |
| MIME-Version | 1.0 |
| X-Received | by 10.180.11.36 with SMTP id n4mr2509951wib.4.1391258458912; Sat, 01 Feb 2014 04:40:58 -0800 (PST) |
| Sender | meltingwax@gmail.com |
| In-Reply-To | <d06a0b0e-3fb9-4e69-8104-bfe4a556fa0e@googlegroups.com> |
| References | <d06a0b0e-3fb9-4e69-8104-bfe4a556fa0e@googlegroups.com> |
| Date | Sat, 1 Feb 2014 07:40:58 -0500 |
| X-Google-Sender-Auth | YAQqSlKR5dvoL9NQs7Eyn6BX4ns |
| Subject | Re: piping with subprocess |
| From | Daniel da Silva <var.mail.daniel@gmail.com> |
| To | Rick Dooling <rpdooling@gmail.com> |
| Content-Type | multipart/alternative; boundary=001a11c258f03bfc8b04f1579a13 |
| X-Mailman-Approved-At | Sat, 01 Feb 2014 14:34:34 +0100 |
| Cc | Python <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 | <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.6277.1391261676.18130.python-list@python.org> (permalink) |
| Lines | 96 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1391261677 news.xs4all.nl 2927 [2001:888:2000:d::a6]:35618 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:65213 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
Try this:
from subprocess import check_output
import sys
check_output("textutil -convert html %s -stdout | pandoc -f html -t
markdown -o %s" % sys.argv[1:3], shell=True)
On Sat, Feb 1, 2014 at 7:19 AM, Rick Dooling <rpdooling@gmail.com> wrote:
> I spent half a day trying to convert this bash script (on Mac)
>
> textutil -convert html $1 -stdout | pandoc -f html -t markdown -o $2
>
> into Python using subprocess pipes.
>
> It works if I save the above into a shell script called convert.sh and
> then do
>
> subprocess.check_call(["convert.sh", file, markdown_file])
>
> where file and markdown_file are variables.
>
> But otherwise my piping attempts fail.
>
> Could someone show me how to pipe in subprocess. Yes, I've read the doc,
> especially
>
> http://docs.python.org/2/library/subprocess.html#replacing-shell-pipeline
>
> But I'm a feeble hobbyist, not a computer scientist.
>
> Thanks
>
> RD
> --
> https://mail.python.org/mailman/listinfo/python-list
>
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
piping with subprocess Rick Dooling <rpdooling@gmail.com> - 2014-02-01 04:19 -0800
Re: piping with subprocess Peter Otten <__peter__@web.de> - 2014-02-01 13:54 +0100
Re: piping with subprocess Rick Dooling <rpdooling@gmail.com> - 2014-02-01 05:54 -0800
Re: piping with subprocess Rick Dooling <rpdooling@gmail.com> - 2014-02-01 06:00 -0800
Re: piping with subprocess Rick Dooling <rpdooling@gmail.com> - 2014-02-01 07:35 -0800
Re: piping with subprocess Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-01 15:59 +0000
Re: piping with subprocess Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-01 14:28 +0000
Re: piping with subprocess Peter Otten <__peter__@web.de> - 2014-02-01 18:32 +0100
Re: piping with subprocess Daniel da Silva <var.mail.daniel@gmail.com> - 2014-02-01 07:40 -0500
csiph-web