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


Groups > comp.lang.python > #87723

Re: Python script output in file

References <mailman.7.1426710494.10327.python-list@python.org> <6250eebf-2730-4eb4-a4a5-f6f1881ab3a2@googlegroups.com>
Date 2015-03-18 20:56 -0700
Subject Re: Python script output in file
From Robert Clove <cloverobert@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.16.1426737741.10327.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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_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 <wink>
> --
> https://mail.python.org/mailman/listinfo/python-list



Thanks all :)

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


Thread

Re: Python script output in file Albert-Jan Roskam <fomcl@yahoo.com> - 2015-03-18 13:22 -0700
  Re: Python script output in file Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-19 10:16 +1100
  Re: Python script output in file Rustom Mody <rustompmody@gmail.com> - 2015-03-18 19:10 -0700
    Re: Python script output in file Robert Clove <cloverobert@gmail.com> - 2015-03-18 20:56 -0700

csiph-web