Jul-13-2020, 10:34 PM
Thank you very much! I strained my brain making this work! Getting the penultimate line was tricky.
Obviously, your code is much better than mine! I don't know about float.
Just out of interest, this is what I did (the extra output is so I can see what is happening, I'll block that later):
My little 'makehtmltable.py' asks me if I want to continue. It needs a 'y' to carry on. Now I can give it a y. This is the output in the text widget
Thanks again for your help!
Obviously, your code is much better than mine! I don't know about float.
Just out of interest, this is what I did (the extra output is so I can see what is happening, I'll block that later):
def retrieve_input(): pos = text_area.index("end-1c") lineNum = pos.split('.') line = int(lineNum[0]) - 1 #echoMessage(str(line)) pos2 = str(line) + '.0' answer = text_area.get(pos2, 'end-1c') echoMessage('answer is ' + answer) echoMessage('pos is ' + pos) echoMessage('pos2 is ' + pos2) echoMessage('line number echoed was ' + str(line)) return pos2;Still using the window you made, I added a button 'Submit answer'
My little 'makehtmltable.py' asks me if I want to continue. It needs a 'y' to carry on. Now I can give it a y. This is the output in the text widget
Quote:Enter y to continue, enter nothing to stop.
y
answer is y
Thanks again for your help!