Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'subject:file': 0.07; 'wednesday,': 0.07; 'subject:script': 0.09; 'cc:addr:python-list': 0.11; '>>': 0.16; '(when': 0.16; '>on': 0.16; 'cet': 0.16; 'proc': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'command': 0.22; '>>>': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; '>>>': 0.24; 'cc:2**0': 0.24; '>': 0.26; 'header:In- Reply-To:1': 0.27; 'robert': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'file': 0.32; 'run': 0.32; 'url:python': 0.33; 'skip:s 30': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'method': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'skip:- 20': 0.37; 'skip:& 10': 0.38; 'pm,': 0.38; 'skip:. 10': 0.39; 'skip:p 20': 0.39; 'url:mail': 0.40; 'how': 0.40; 'march': 0.61; 'name': 0.63; 'to:addr:gmail.com': 0.65; 'mar': 0.68; '2015': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IPKC5Iw+Zjs8apUPCgvc/EShX9PXEOmD5D8feAD7598=; b=j0merLPmv/plwiw7g+1qZoBTAzIwD0Wxca182Hu4m7gmHySpHQG7JQB6RdyV+R8HcH rLdr1tBh3/B9Ic4bkMqil7QgiCAmS5m77pBIzHcOfsQlcGydTe/45lmh1tcfS6nSZsrP FJUBZCjAGzSLRkcW8TcbmDlZQz6ugJ2+HV8CwzjYyr8LIrN0ovE4QHYCN+FDlIHAMVzU PMmqvb7PsX5+ie1F6K7VPOTekWlcX3Cfo/ap3RTi4Ulu++lNt1eNpMZXyFyNOxOcaOTL v3096xeMfPaEH0mX7Jv4RTpGWElSDk5wNKP/tzZJKswBfMrfWrcw4IYL2gl8Uxswkmvv s7PQ== MIME-Version: 1.0 X-Received: by 10.202.210.215 with SMTP id j206mr27978712oig.131.1426737405666; Wed, 18 Mar 2015 20:56:45 -0700 (PDT) In-Reply-To: <6250eebf-2730-4eb4-a4a5-f6f1881ab3a2@googlegroups.com> References: <6250eebf-2730-4eb4-a4a5-f6f1881ab3a2@googlegroups.com> Date: Wed, 18 Mar 2015 20:56:45 -0700 Subject: Re: Python script output in file From: Robert Clove To: Rustom Mody Cc: "python-list@python.org" Content-Type: multipart/alternative; boundary=001a113d299440adea05119c30af X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 70 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426737741 news.xs4all.nl 2867 [2001:888:2000:d::a6]:39214 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87723 --001a113d299440adea05119c30af Content-Type: text/plain; charset=UTF-8 On Wed, Mar 18, 2015 at 7:10 PM, Rustom Mody wrote: > On Thursday, March 19, 2015 at 1:58:29 AM UTC+5:30, Albert-Jan Roskam > wrote: > > ---------------------------- > > On Wed, Mar 18, 2015 7:06 PM CET Rustom Mody wrote: > > > > >On Wednesday, March 18, 2015 at 8:12:12 PM UTC+5:30, Robert Clove wrote: > > >> ./my_eth_script.pl eth0 M > a.txt > > >> > > >> How can i run this command with subprocess.popen > > > > > >Something like this I guess? > > > > > >>> proc = Popen("cat", shell=True, stdout=open(inname, "w"), > stdin=open(outname,"r")) > > > > > > How will the file object associated with in name be closed? (When is > close() method called? > > Just like the close-paren in the line above > -- > https://mail.python.org/mailman/listinfo/python-list Thanks all :) --001a113d299440adea05119c30af Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Wed, Mar 18, 2015 at 7:10 PM, Rustom Mody <rustompmody@gmail.com> wrote:
On = Thursday, March 19, 2015 at 1:58:29 AM UTC+5:30, Albert-Jan Roskam wrote: > ----------------------------
> On Wed, Mar 18, 2015 7:06 PM CET Rustom Mody wrote:
>
> >On Wednesday, March 18, 2015 at 8:12:12 PM UTC+5:30, Robert Clove = wrote:
> >> ./
my_et= h_script.pl eth0 M > a.txt
> >>
> >> How can i run this command with subprocess.popen
> >
> >Something like this I guess?
> >
> >>> proc =3D Popen("cat", shell=3DTrue, stdout=3Dop= en(inname, "w"), stdin=3Dopen(outname,"r"))
>
>
> How will the file object associated with in name be closed? (When is c= lose() method called?

Just like the close-paren in the line above <wink>
--
https://mail.python.org/mailman/listinfo/python-list


Thanks all :)=C2=A0

--001a113d299440adea05119c30af--