discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] os.popen broken pipe error


From: satarkar
Subject: Re: [Discuss-gnuradio] os.popen broken pipe error
Date: Mon, 13 Apr 2009 00:52:47 -0400 (EDT)
User-agent: SquirrelMail/1.4.16

> On Sun, Apr 12, 2009 at 08:42:59PM -0400, address@hidden wrote:
>> Hi,
>>
>> I am trying to open one python script from another using the following
>> code:
>>
>>
>> command = 'python send.py -d %d -s %d -c %d -n %d -f trash_file.txt'
>> %(dest_addr, sender_addr, cmd, seqno)
>> os.popen(command)
>>
>> I get the broken pipe error for some reason. Can anyone please explain
>> what is happening? Following are the file links if you want to reproduce
>> the error:
>
> A "broken pipe" occurs when when you attempt to write on a pipe
> without a reader (See man 7 pipe).
>
> You're not specifying the second argument to os.popen.
> It defaults to 'r'.  Do you want 'w'?
>
> See the python library reference for more info.
>
>> http://www.eden.rutgers.edu/~aanchan/input.txt
>> http://www.eden.rutgers.edu/~aanchan/send.py
>> http://www.eden.rutgers.edu/~aanchan/transceiver.py
>> http://www.eden.rutgers.edu/~aanchan/trash_file.txt
>>
>> I am calling send.py from transceiver.py. The txt files are used as
>> inputs.
>>
>> thanks and regards,
>>
>> -Sumit
>>
>
> Eric
>

I was surprised actually when I got the above mentioned bug because I had
have always been giving only one argument, when I wanted the "command" to
be executed on the shell. Anyway, the problem was actually solved when I
stored the output of the above "command" in a text file (rx_ack_log.txt)
as follows:

command = 'python send.py -d %d -s %d -c %d -n %d -f trash_file.txt >>
rx_ack_log.txt' %(dest_addr, sender_addr, cmd, seqno)
os.popen(command)

thanks for the help!
regards,
-Sumit




reply via email to

[Prev in Thread] Current Thread [Next in Thread]