This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients louielu, terry.reedy
Date 2017-09-04.19:10:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504552237.98.0.991531379348.issue31331@psf.upfronthosting.co.za>
In-reply-to
Content
In my example the screen before the output had

>>> go()
>>> a = 
           12,|

where '|' is the blinking input cursor.  The '\n' terminated print output is inserted *after* '>>> ' but before the imcomplete statement.  When the statement  I want it *before* the prompt, with '\n' appended if necessary.  In the minimized example, the result would be

 >>> from threading import Timer
>>> Timer(0.1, lambda: print('hello'), ()).start()
'hello'
>>>

If delayed output 'junk' does not end with '\n', we can get

>>> junkg=4  # 'g' started where the 'j' ends up.
>>> g
4

This is buggy as a history listing.

IDLE's current behavior, which keeps user input and program output better separated, is much better than interactive Python in the console Steven used, where the output is placed at the end of the incomplete statement, which is a nuisance.

The first step is to find where text from the user program is inserted into the Shell text box.  Then, how is the insertion point moved back -- but just not quite far enough. The solution might then be obvious.

A 'deeper' idea that would solve this (and other issues) is a separate Shell input box (without '>>> ') under the Shell history box.  But that is a separate discussion.
History
Date User Action Args
2017-09-04 19:10:38terry.reedysetrecipients: + terry.reedy, louielu
2017-09-04 19:10:37terry.reedysetmessageid: <1504552237.98.0.991531379348.issue31331@psf.upfronthosting.co.za>
2017-09-04 19:10:37terry.reedylinkissue31331 messages
2017-09-04 19:10:37terry.reedycreate