Terry J. Reedy added the comment:
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.
try:
import idlelib
idlelib.run
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.
----------
stage: needs patch -> patch review
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23220>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com