read() / readline() / readlines()
Dave Lajoie
davelaj at videotron.ca
Wed Mar 9 00:24:06 EST 2005
Hello!
would someone know a method that allows
to read line delimited by "\n" instead of trapping "\0" like
readlines does?
I have to write my own while loop to do this.
while myThread.isAlive() == True:
myChar = p.stdout.read(1)
if myChar == '\0':
print "Found EOF, exiting!"
break
myStr = myStr + myChar
if myChar == '\n':
print myStr
myStr = ""
continue
is there a more elegant way to do this?
tx
Dave.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050309/9c0b98c6/attachment.html>
More information about the Python-list
mailing list