我是一个新的Python用户,我确信这是一个非常基本的问题,但我无法在任何地方找到答案.当人们在线发布Python代码时,它的格式通常如下:
In [1]: # some stuff
Out[1]:
# some more stuff
什么是In,Out和数字?为什么我的Python控制台不那样?
解决方法:
它们不是Python代码.它们是IPython prompts,一个流行的Python附加交互式shell.
在交互式提示符上执行的每行代码(用In表示)都被编号,产生的输出也是编号(用Out表示).然后,您可以指示IPython返回那些输入和输出以重新运行代码或重新使用输出.
IPython offers numbered prompts (In/Out) with input and output caching (also referred to as ‘input history’). All input is saved and can be retrieved as variables (besides the usual arrow key recall), in addition to the %rep magic command that brings a history entry up for editing on the next command line.
标签:python