As much as possible, the result of executing Python code with IDLE is
the same as executing the same code in a console window. However, the
different interface and operation occasionally affects visible
results. For instance, sys.modules starts with more entries.
IDLE also replaces sys.stdin, sys.stdout, and sys.stderr with objects
that get input from and send output to the Shell window. When this
window has the focus, it controls the keyboard and screen. This is
normally transparent, but functions that directly access the keyboard
and screen will not work. If sys is reset with importlib.reload(sys),
IDLE’s changes are lost and things like input, raw_input, and print
will not work correctly.
With IDLE’s Shell, one enters, edits, and recalls complete statements.
Some consoles only work with a single physical line at a time. IDLE
uses exec to run each statement. As a result, 'builtins' is
always defined for each statement.
当您从任何空闲编辑器运行代码时,它会添加您的File=>;Recent files列表,该列表用于您运行的任何空闲版本。我经常把一个文件拉到另一个运行的版本中,看看它是否运行相同,也许是在2.7和3.x之间的已知差异进行了修订之后
我应该补充一些同样深奥的东西。在
相关问题 更多 >
编程相关推荐