I have a StringIO object the is filled correctly. I than have the following code:
val = log_fp.getvalue()
lines = val.split('\n')
newval = ''
for line in lines:
if (not line.startswith('[output]')):
newval = line
print 'test1'+newval
print 'test2' +newval
in the loop, I have the correct value for newval printed, but in the last print, I have an empty string. Any ideas what I am doing wrong? What I need is to extract one of the lines in the stringIO object that is marked [output], but newval seems to be empty in 'test2'.
newval? That way, you could see if python is printing a newline character.