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: 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> <16e85bd1-6e5d-4d70-95bf-cc6b986a9f7c@googlegroups.com> <8f26ac4d-4732-46ac-bf4e-877696b22241@googlegroups.com> <85cd2254-0800-4448-9117-9175bbfd10f6@googlegroups.com> <4b4a7bc9-8283-4653-841e-d648a7586fb9@googlegroups.com> From: Oscar Benjamin 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 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: 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 On 19 February 2013 10:27, 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