Re: Python script output in file

2015-03-20 Thread Albert-Jan Roskam
- On Thu, Mar 19, 2015 12:16 AM CET Steven D'Aprano wrote: >On Thu, 19 Mar 2015 07:22 am, 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, Ro

Re: Python script output in file

2015-03-18 Thread Robert Clove
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

Re: Python script output in file

2015-03-18 Thread Rustom Mody
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

Re: Python script output in file

2015-03-18 Thread Steven D'Aprano
On Thu, 19 Mar 2015 07:22 am, 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 wit

Re: Python script output in file

2015-03-18 Thread Chris Angelico
On Thu, Mar 19, 2015 at 7:22 AM, 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

Re: Python script output in file

2015-03-18 Thread Albert-Jan Roskam
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 = Pope

Re: Python script output in file

2015-03-18 Thread Rustom Mody
On Wednesday, March 18, 2015 at 11:36:39 PM UTC+5:30, 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 = Pope

Re: Python script output in file

2015-03-18 Thread Rustom Mody
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")) inname and

Re: Python script output in file

2015-03-18 Thread Robert Clove
./my_eth_script.pl eth0 M >> a.txt How can i run this command with subprocess.popen On Wed, Mar 18, 2015 at 3:49 AM, Rustom Mody wrote: > On Wednesday, March 18, 2015 at 4:06:05 PM UTC+5:30, Robert Clove wrote: > > Hi, > > > > I have a perl script named "my_eth-traffic.pl" which calculates the

Re: Python script output in file

2015-03-18 Thread Rustom Mody
On Wednesday, March 18, 2015 at 4:06:05 PM UTC+5:30, Robert Clove wrote: > Hi, > > I have a perl script named "my_eth-traffic.pl" which calculates the tx and rx > speed of the Ethernet interface in Mb. > > I want to run this script from another script and want the output in other > file. > So i

Python script output in file

2015-03-18 Thread Robert Clove
Hi, I have a perl script named "my_eth-traffic.pl" which calculates the tx and rx speed of the Ethernet interface in Mb. I want to run this script from another script and want the output in other file. So i wrote the following script but not getting the output. #!/usr/bin/python import sys impo