Julio Sergio wrote:
> J. Cliff Dyer sdf.lonestar.org> writes:
>
>>
>> readlines() reads all the lines from the filehandle, but the filehandle
>> hasn't signalled that it is done writing lines, so fo is waiting until
>> fi is complete. You either need to keep reading one line at a time, and
>>
It is for reading all the lines from a complete file. If the file is
still being written to, it doesn't have an end yet. File objects do
many things besides RPC. Also, there are instances where all you want
to do is block until the file is done, and then get all the content.
readlines will do th
J. Cliff Dyer sdf.lonestar.org> writes:
>
> readlines() reads all the lines from the filehandle, but the filehandle
> hasn't signalled that it is done writing lines, so fo is waiting until
> fi is complete. You either need to keep reading one line at a time, and
> manually release control when
On 7 June 2012 17:04, Julio Sergio wrote:
> I'm trying to call an external process to filter some of my data, i.e., I'm
> trying to pass some information to the called process, and have this
> information
> back transformed. I started testing with the linux 'cat' command, in this
> way:
>
>
> ->>
MRAB mrabarnett.plus.com> writes:
>
> I believe it's waiting for the end of the input, i.e. for the pipe to
> close.
>
> Have you tried calling fo.readline() 3 times instead?
>
yeah! It worked!...
A question remains: what is then the purpose of fo.readlines(...)?
Thanks,
--Sergio
--
htt
On Thu, 2012-06-07 at 16:04 +, Julio Sergio wrote:
> Up to this point it worked as expected. However, when I tryied with the
> methods
> that write and read several lines, apparently the process got stalled:
>
> ->>> fi.writelines(["uno\n","dos\n","tres\n"])
> ->>> fi.flush()
> ->>> s = fo.
On 07/06/2012 17:04, Julio Sergio wrote:
I'm trying to call an external process to filter some of my data, i.e., I'm
trying to pass some information to the called process, and have this information
back transformed. I started testing with the linux 'cat' command, in this way:
->>> import subpr
I'm trying to call an external process to filter some of my data, i.e., I'm
trying to pass some information to the called process, and have this
information
back transformed. I started testing with the linux 'cat' command, in this way:
->>> import subprocess as sp
->>> p = sp.Popen(["cat"],std