python - spyder:编辑继续在 python 中执行,而不是 IPython

标签 python ipython anaconda spyder

我正在使用spyder 3 来运行python,但不确定如何让我的 session 运行IPython。

我启动spyder,然后单击控制台,然后选择“打开 IPython 控制台”。然后我在右下象限看到有一个 Python 和 IPython 控制台。我确保选择了 IPython 控制台。

然后我在编辑器中运行一些代码:

import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(10, 4))
print(df)

但是,当我按 F5 时,我得到了以下返回:

NOTE: The Python console is going to be REMOVED in Spyder 3.2. Please start to migrate your work to the IPython console instead.

          0         1         2         3
0  0.383901 -1.021537  0.721708 -0.389721
1 -0.779638  0.010816  0.668723 -1.007539
2 -0.918172  1.100903  0.437585 -0.750007
3  0.822504 -2.546719  0.069220 -1.096228
4  1.040603  0.769918 -1.608101  0.279524
5  0.156436  0.518157 -1.278696  0.413262
6  0.211114  0.194401 -0.323856  0.988171
7  0.436519  0.611610 -1.027762  1.546440
8 -0.493041 -0.195899  0.616378 -0.135764
9 -0.355428  0.896633  0.535350  0.189172

我想在 IPython 中运行,但不确定我做错了什么或缺少一些基本的东西。关于如何让它在 IPython 中执行有什么想法吗?

仅供引用,我正在运行 Windows 10 并通过 anaconda 安装了spyder。

谢谢。

最佳答案

在Win7上通过anaconda安装了spyder。无法重现此案例。

您想知道的事情:-

他们将从spyder 3.2中删除Python控制台,并且仅存在IPython控制台。

当前spyder中没有选项可以在专用的IPython控制台中运行代码。这将在即将发布的版本中添加。

你可以尝试什么:-

转到 IPython 控制台并输入命令 runfile("path_to_py_file",wdir="working_directory")

然后按 Enter 键。

关于python - spyder:编辑继续在 python 中执行,而不是 IPython,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45931674/

相关文章:

python - anaconda安装github包时没有这样的文件或目录错误

python - 如何在 Anaconda 中使用 Python Dbus 绑定(bind)

python - 将 HTML 属性值与 Flask 数据连接起来

python - IPython 5,用于执行代码块而不是插入新行的键

python - iPython 是否内置支持在寻呼机中查看变量?

ipython - 如何将 ipython 从 0.12 升级到 0.13?

java - Dockerfile 无法复制指定的本地目录和文件

python - 类型错误: 'int' 对象不可迭代

python - 属性错误: 'module' object has no attribute '' when using pickle over sockets

python - 在 csv.writer 中添加空格作为分隔符