End of file?

S

Steve

Hi,

I'm having trouble finding out if output from a pipe has finished (i.e.
I can't find tell if there's a EOF in output.readlines()). How do I do
this? Because readlines() can return empty lines and I can't simply
check if the line is empty. Please somebody help me!

Thanks.

Steve
 
R

Rene Pijlman

Steve:
I'm having trouble finding out if output from a pipe has finished (i.e.
I can't find tell if there's a EOF in output.readlines()). How do I do
this? Because readlines() can return empty lines and I can't simply
check if the line is empty.

You don't get an EOF from readlines().

"readlines([sizehint])

Read until EOF using readline() and return a list containing the lines
thus read."

http://www.python.org/doc/current/lib/bltin-file-objects.html
 
S

Steve

Rene said:
Steve:
I'm having trouble finding out if output from a pipe has finished (i.e.
I can't find tell if there's a EOF in output.readlines()). How do I do
this? Because readlines() can return empty lines and I can't simply
check if the line is empty.


You don't get an EOF from readlines().

"readlines([sizehint])

Read until EOF using readline() and return a list containing the lines
thus read."

http://www.python.org/doc/current/lib/bltin-file-objects.html

Thanks :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,174
Messages
2,570,940
Members
47,486
Latest member
websterztechnologies01

Latest Threads

Top