我一直在尝试使用numpy和matplotlib,并在从emacs内置shell中运行Python时遇到了一些错误。
当我将py文件发送到shell解释器后,我可以在代码执行后运行命令。 命令提示符“ >>>”显示正常。 但是,在对绘图调用matplotlib show命令后,shell挂起,命令提示符没有显示。
>>> plt.plot(x,u_k[1,:]);
[<matplotlib.lines.Line2D object at 0x0000000004A9A358>]
>>> plt.show();
我正在使用传统的C-Python实现,在Win7上使用Fabian Gallina的Python python.el v.0.23.1在emacs 23.3下运行。
类似的问题已经在i-python平台下提出:running matplotlib or enthought.mayavi.mlab from a py-shell inside emacs on windows
更新:我在全新安装的Win 7 x64上重现了这个问题,安装了从python网站获取的典型python 2.7.2二进制文件,并且在Windows上使用numpy 1.6.1和matplotlib 1.1.0进行了测试,emacs版本为23.3和23.4。
emacs shell中一定存在某个bug。
ansi-term
或eshell
吗?我记得读过一些应用程序不喜欢M-x shell
提供的 IO 重定向。有关概述,请参阅此备选 shell 的文章。 - Devin M