Interprocess comunication

Julio Sergio juliosergio at gmail.com
Thu Jun 7 12:45:01 EDT 2012


J. Cliff Dyer <jcd <at> 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 there's nothing more to read, or you need
> to do an fi.close() before you try to use fo.readlines().
> 
> 

Thanks... It worked as you said. Here is how I coded it:

->>> fi.writelines(["uno\n","dos\n","tres\n"])
->>> fi.close()
->>> l = fo.readlines()
->>> l
['uno\n', 'dos\n', 'tres\n']


--Sergio




More information about the Python-list mailing list