本文介绍了什么是ipython笔记本“终端"?菜单选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OSX机器和/或ubuntu 14.04机器上运行ipython笔记本.我正在使用ipython 3.0.0和ipython(jupyter)笔记本.

I am running ipython notebook on my OSX machine and/or my ubuntu 14.04 machine. I am using ipython 3.0.0, and ipython (jupyter) notebooks.

当我启动ipython笔记本时,在新建"下有一个终端选项,但对我来说不可用.我尚未找到有关此功能,如何激活它或做什么的任何文档.ipython notebook --help命令没有提及它,并且在文档之一.我也没有发现用于搜索Google以获得任何信息的特殊关键字.

When I start an ipython notebook, under New there is a terminal option, but it's unavailable for me.I haven't been able to find any documentation on this feature, how to activate it or what it does.The ipython notebook --help command doesn't mention it and I haven't found anything in the documentation either.I haven't discovered the special keywords to search google for to get any information either.

此功能有什么作用?如何激活它?对此有任何文档吗?

What does this feature do? How do I activate it? Is there any documentation on this available?

推荐答案

这是Lib/site-packages/IPython/html/notebookapp.py中负责此项的代码(通过区分大小写搜索"Terminals"的源来定位文件)

Here's the code in Lib/site-packages/IPython/html/notebookapp.py responsible for this item (located the file by searching the source for "Terminals" case-sensitively):

def init_terminals(self):
    try:
        from .terminal import initialize
        initialize(self.web_app)
        self.web_app.settings['terminals_available'] = True
    except ImportError as e:
        log = self.log.debug if sys.platform == 'win32' else self.log.warn
        log("Terminals not available (error was %s)", e)

如您所见,控制台日志中应该有一条消息,指出出了什么问题(您可能需要使用ipython notebook --log-level=<level>增加日志的详细程度,才能看到它).就我而言,它说:

As you can see, there should be a message in the console log specifying what went wrong (you may need to increase log verbosity with ipython notebook --log-level=<level> to see it). In my case, it said:

正在导入的html.terminal模块似乎提供了一个基于Web的IPython交互式控制台.

The html.terminal module that is being imported appears to provide a web-based IPython interactive console.

这篇关于什么是ipython笔记本“终端"?菜单选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 04:39