我以前认为这是 IPython 的问题,但今天我再次测试,这是我所做的:
emacs -Q
在cmd窗口中运行- 打开一个 .py 文件
M-x
, 然后运行python-shell-switch-to-shell
,RET
和RET
. 然后我准备好了 Python shell- 然后我输入以下代码:
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt >>> plt.ion() >>> plt.plot([1,2,3]) [<matplotlib.lines.Line2D object at 0x03068610>] >>>
实际上在此之后,没有数字出现,并且外壳被冻结,例如,当我输入时:
>>> print("hello")
什么也没发生...我没有测试过其他绘图工具,但 matplotlib。我不知道这是否是一个错误。我已经搜索了一段时间,在这里和谷歌,但没有运气。我的系统是:Emacs 24.3 32 bit for Windows,在 Windows 7 下。如果其他人可以复制与此处相同的问题,我会将其报告为错误。
我通过以下方式使用 IPython 作为 Python shell:
C:/Python27/python.exe -i C:/Python27/Scripts/ipython-script.py --pylab
然后,我figure(); plot([1,2,3])
按预期输入了图形弹出并冻结。然后我做了:C-c C-d
which runs comint-send-eof
,并且这个数字实际上得到了更新!但是我的 IPython shell 会话也以以下消息终止:
In [6]:
Do you really want to exit ([y]/n)?
Traceback (most recent call last):
File "C:/Python27/Scripts/ipython-script.py", line 9, in <module>
load_entry_point('ipython==0.13.1', 'console_scripts', 'ipython')()
SystemExit
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True
这里有什么有用的线索吗?!