Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!nuzba.szn.dk!pnx.dk!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.041 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'assigning': 0.09; 'subject:python': 0.11; 'dup2': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'luck,': 0.16; 'redirects': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'chris': 0.28; '(possibly': 0.29; 'i/o': 0.29; 'fri,': 0.30; 'code': 0.31; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'doing': 0.35; 'received:209.85': 0.35; "i'll": 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; '2013': 0.84; 'start.': 0.84; 'streams': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=TEdwouH5YmM4wV4yFXrfXt7f84yxpDMPMTksXuXLQms=; b=o3Twd9qWk2Z/rZyBS4dhHsRCw/Y6MmcRh8GG6xAm6inxEG8pAknyCs5sge51QSns6O VCTuHZ383UO3cDUcpfwzFZ8xSjGkaQq0r4HTM2twv5aO2oOLdACafL2uEWHaaLJtMs1Q fCMXpgYbZSYnuYFu7MoWfb302W57T8Vy52k8I5NxTmGkgBr3qlL9GnIkdenWlAf2AGSK HwgGz3wMcMBurRRIqvpRsV9lfEZA0QZhEJGUFMeTRAoXGtnatnjvKDi2U6E7m1zQyiMO Wnpl8BzJuqm3EdyAffRDfrWNPv8kfv9psnT1QMn23bbOn6ix9jvNciJw60fjxND3HoRY /5pA== MIME-Version: 1.0 X-Received: by 10.220.240.80 with SMTP id kz16mr5912545vcb.7.1358438093122; Thu, 17 Jan 2013 07:54:53 -0800 (PST) In-Reply-To: <1908dad0-7f29-4b54-a244-7cb89510e9b0@googlegroups.com> References: <2699150a-cf67-46ac-b863-34c92bffceaf@googlegroups.com> <1908dad0-7f29-4b54-a244-7cb89510e9b0@googlegroups.com> Date: Fri, 18 Jan 2013 02:54:53 +1100 Subject: Re: python sys.stdout and C++ iostreams::cout From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358438101 news.xs4all.nl 6979 [2001:888:2000:d::a6]:37087 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36949 On Fri, Jan 18, 2013 at 2:51 AM, Utpal Sarkar wrote: > Thanks a lot Chris and Nobody! I'll have a look at dup2 for a start. Okay. Look for code that redirects the standard I/O streams and then exec()s another process (possibly after fork()ing); you're going to be doing pretty much the same thing. Good luck, have fun. It's a LOT messier than simply assigning to sys.stdout, unfortunately. ChrisA