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


Groups > comp.lang.python > #39207

Re: improving performance of writing into a pipe

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <oscar.j.benjamin@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'that?': 0.05; 'debugging.': 0.07; 'python': 0.09; 'explanation': 0.09; 'happen.': 0.09; 'of)': 0.09; 'open()': 0.09; 'subject:into': 0.09; 'thread,': 0.09; 'cc:addr:python-list': 0.10; ':-)': 0.13; 'cc:name:python list': 0.16; 'deprecated.': 0.16; 'people?': 0.16; 'singular': 0.16; 'subject:writing': 0.16; 'subprocess': 0.16; 'try/except': 0.16; 'wrote:': 0.17; 'fix': 0.17; 'saying': 0.18; '(or': 0.18; 'appropriate': 0.20; 'code.': 0.20; 'followed': 0.20; 'suggested': 0.20; 'error.': 0.21; '(all': 0.22; 'explicit': 0.22; 'cc:2**0': 0.23; 'work.': 0.23; 'errors': 0.23; 'seems': 0.23; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'received:209.85.212': 0.28; 'run': 0.28; 'post': 0.28; 'prints': 0.29; "i'm": 0.29; 'error': 0.30; 'code': 0.31; 'problem.': 0.32; 'getting': 0.33; 'message.': 0.33; 'problem': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'list': 0.35; 'built-in': 0.35; 'open': 0.35; 'posting': 0.35; 'received:209.85': 0.35; 'explain': 0.36; 'but': 0.36; 'wanted': 0.36; 'should': 0.36; 'enough': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'your': 0.60; 'remove': 0.61; 'procedure': 0.61; 'here:': 0.62; 'here': 0.65; 'person,': 0.65; 'reply': 0.66; 'wish': 0.70; '2013': 0.84; 'oscar': 0.84; '"it': 0.91; 'seriously,': 0.91; 'convinced': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=V91M6GC9GOirK+2FfxiVJ0W7xbZbdOp5Q6n5KwGsxS8=; b=FJni7iZWpfBg+yUts0RyuwK0XIyGLec9oQyHYYJablPPU1NQaZWvk3fxwjxJ3hq2HJ VrxNpk/Aqiaiw3XDNO9ULZe6FYuBkXC5HWSU4/e+qrNKenDMOCZSvapUbLnepNAnrge7 ikTFXOIzEuL1m1jkBkL0efQmPPX85iu28XeARI7L1TSGG1EP/ddPAQvnoKVSV9A2pC20 4SfLAJX+4MHQBf7wg58wCmDAeSHS3rqyxuVCBhOsItMZNdP02RUfqvy+1GvQplv6IZpn mVEUqvzu4FTYhXkvJmJeEA3mSVncYUkieMDOfHp9pjmPBa+H1/xbrMnuxsVBC2e+E0Xo DD6w==
X-Received by 10.52.90.140 with SMTP id bw12mr17374758vdb.50.1361272554979; Tue, 19 Feb 2013 03:15:54 -0800 (PST)
MIME-Version 1.0
In-Reply-To <4b4a7bc9-8283-4653-841e-d648a7586fb9@googlegroups.com>
References <76620a9e-45fe-499d-b1bf-06b1d2a91c25@googlegroups.com> <mailman.1952.1361200943.2939.python-list@python.org> <16e85bd1-6e5d-4d70-95bf-cc6b986a9f7c@googlegroups.com> <kftm2l$b84$1@r03.glglgl.gl> <8f26ac4d-4732-46ac-bf4e-877696b22241@googlegroups.com> <mailman.1958.1361211131.2939.python-list@python.org> <85cd2254-0800-4448-9117-9175bbfd10f6@googlegroups.com> <mailman.2012.1361267738.2939.python-list@python.org> <4b4a7bc9-8283-4653-841e-d648a7586fb9@googlegroups.com>
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date Tue, 19 Feb 2013 11:15:34 +0000
Subject Re: improving performance of writing into a pipe
To mikprog@gmail.com
Content-Type text/plain; charset=ISO-8859-1
Cc Python List <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.2016.1361272558.2939.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1361272558 news.xs4all.nl 6978 [2001:888:2000:d::a6]:57884
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:39207

Show key headers only | View raw


On 19 February 2013 10:27,  <mikprog@gmail.com> wrote:
>> can work. As a few people already told you the built-in open()
>
>
> Few people?
> I thought Oscar was a singular person, not a group of people :-)

Serhiy also suggested it.

> Seriously, I am convinced by that approach (thanks) and I wish to go that way, but the problem I am getting now is that the open fails and then I can't go on.

Perhaps no-one has been explicit enough about what you should do here:

1) Remove all try/except from your code.
2) Run the code
3) Look at the *unadulterated* error message that Python prints out
4) Either fix the error if you know how or
5) Reply here posting the exact error message.

Also, in future:
6) Don't use bare try/except and don't catch errors while you're
debugging. Allow the errors to be printed as they are so that you can
read the message and see the line that triggers the error.
7) Don't post to a mailing list saying "I get an error", "I can see
errors" or "it doesn't work". If you have errors paste the exact error
message (all of it!). If you don't get errors but it doesn't do what
you want explain exactly what happened and also what you wanted to
happen. If you had followed this procedure at the start of this
thread, then you would already have a solution to (or at least an
explanation of) your problem by now.

> Also, I am now looking at the subprocess as os.popen seems deprecated.
> Any opinion on that?

I'm not convinced that either is appropriate for your problem.


Oscar

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


Thread

improving performance of writing into a pipe mikprog@gmail.com - 2013-02-18 07:12 -0800
  Re: improving performance of writing into a pipe Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-18 15:21 +0000
    Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-18 08:31 -0800
      Re: improving performance of writing into a pipe Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-02-18 17:49 +0100
        Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-18 09:00 -0800
          Re: improving performance of writing into a pipe Michael Torrie <torriem@gmail.com> - 2013-02-18 11:12 -0700
            Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 01:24 -0800
              Re: improving performance of writing into a pipe Peter Otten <__peter__@web.de> - 2013-02-19 10:55 +0100
                Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 02:27 -0800
                Re: improving performance of writing into a pipe Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-19 11:15 +0000
                Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 02:27 -0800
              Re: improving performance of writing into a pipe Michael Torrie <torriem@gmail.com> - 2013-02-19 10:47 -0700
                Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-20 09:54 -0800
                Re: improving performance of writing into a pipe John Gordon <gordon@panix.com> - 2013-02-20 18:39 +0000
                Re: improving performance of writing into a pipe Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-20 22:05 +0000
                Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-20 09:54 -0800
            Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 01:24 -0800
    Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-18 08:31 -0800
  Re: improving performance of writing into a pipe Serhiy Storchaka <storchaka@gmail.com> - 2013-02-18 21:29 +0200
    Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 04:10 -0800
    Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 04:10 -0800
    Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 05:39 -0800
      Re: improving performance of writing into a pipe Peter Otten <__peter__@web.de> - 2013-02-19 14:57 +0100
        Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 06:38 -0800
        Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 06:38 -0800
    Re: improving performance of writing into a pipe mikprog@gmail.com - 2013-02-19 05:39 -0800

csiph-web