Author terry.reedy
Recipients Al.Sweigart, docs@python, martin.panter, ned.deily, serhiy.storchaka, terry.reedy, willingc
Date 2015-07-12.03:55:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I was thinking AttributeError, as mentioned in the previous sentence.  But you are correct that ImportError is possible too.  Maybe I should just give the code.

    import idlelib
    running_idle = True
except (ImportError, AttributeError):
    running_idle = False

tk does not 'handle' stdout. Idle does, by inserting strings into a tk text widget. tk does not care where inserted chars come from. tk \b behavior is OS dependent. tk may always ignore \r, but this is different from (at least some) consoles. Attempt 2, with and added paragraph.

  * Except for newline ('\n'), tk handling of ascii control chars may depend on the OS and may by different from text consoles.  Both are true for backspace ('\b') and the latter for return ('\r'), which tk ignores.

These differences noted above are not bugs. If an application is going to be run repeatedly after being developed with Idle, it should usually be run directly, without Idle.  (An exception would be non-gui Windows apps that need tk's better unicode support.) That means testing at least once without Idle.

Thanks for the comments.
Date User Action Args
2015-07-12 03:55:25terry.reedysetrecipients: + terry.reedy, ned.deily, docs@python, martin.panter, Al.Sweigart, serhiy.storchaka, willingc
2015-07-12 03:55:25terry.reedysetmessageid: <>
2015-07-12 03:55:25terry.reedylinkissue23220 messages
2015-07-12 03:55:24terry.reedycreate