Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'command.': 0.09; 'output': 0.10; 'ideas?': 0.16; 'subject:question': 0.18; 'subject:skip:s 10': 0.18; '(which': 0.19; 'header:In-Reply-To:1': 0.22; 'command': 0.24; 'variable': 0.24; 'code': 0.25; 'thanks.': 0.26; "i'm": 0.27; 'all,': 0.28; 'capture': 0.32; 'to:addr:python-list': 0.33; 'charset:us-ascii': 0.36; 'file': 0.36; 'executing': 0.37; 'but': 0.37; 'to:addr:python.org': 0.39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=dannwong@cisco.com; l=368; q=dns/txt; s=iport; t=1313478247; x=1314687847; h=mime-version:content-transfer-encoding:subject:date: message-id:in-reply-to:references:from:to; bh=DszIyebd31pXWe1tnAl8yJ20bmzN7yMbRnjIrk13Yuk=; b=SriNUaiXYe0DoPYUADuaFlzbFzEhc0V3/tyYwevdT+PbYYtuMo9EI+ht ZccDna8N3PmVUZRhRzCEsJGZPQ8eGhGgqaNmvnDn6VNpBb/N/OgMWfAjG oiKGfNak06rflsOQQ+Q3vF3FaXN52G5BiTM2VZS9dktiTGoGBfQhcpkRt E=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkwHAFQVSk6tJV2d/2dsb2JhbABBmRKPCneBQQEBAQMSAR0KTwIBKgYYBgFWAQEEGxqjJQGfFIVoXwSHX5BIi34 X-IronPort-AV: E=Sophos;i="4.67,378,1309737600"; d="scan'208";a="13455078" X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: subprocess.Popen question Date: Tue, 16 Aug 2011 02:03:50 -0500 In-Reply-To: <4E49AB3E.9000801@web.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: subprocess.Popen question Thread-Index: Acxb4qaVd18dDdypRyWw5bRCKOpK/w== References: <4E49AB3E.9000801@web.de> From: "Danny Wong (dannwong)" To: X-OriginalArrivalTime: 16 Aug 2011 07:03:58.0488 (UTC) FILETIME=[AB7F3980:01CC5BE2] X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313478249 news.xs4all.nl 23898 [2001:888:2000:d::a6]:59062 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11515 Hi All, I'm executing a command which I want to capture the standard/stderr output into a file (which I have with the code below), but I also want the standard output to go into a variable so I can process the information for the next command. Any ideas? Thanks. CMD_OUTPUT =3D subprocess.Popen(COMMAND, stdout=3DPROJECT_LOGFILE, stderr=3Dsubprocess.STDOUT)