相关疑难解决方法(0)

使用选定的浏览器启动IPython笔记本

我试图用非默认浏览器启动IPython(在我的情况下是Firefox),并且我认为我可以复制复制该博客中给出的脚本

我在Windows 7上

我把以下代码放在一个文件中说"module.py"

import subprocess
subprocess.call("ipython notebook --no-browser", shell=True)
subprocess.call([r'C:\Program Files (x86)\Mozilla Firefox\Firefox.exe', '-new-tab', 'http://127.0.0.1:8888/'])
Run Code Online (Sandbox Code Playgroud)

但是,当我从命令行运行它时

 python C:\Users\mugabal\Desktop\module1.py
Run Code Online (Sandbox Code Playgroud)

它执行第一行而不是第二行(两行都单独工作)

我的问题(用更通用的术语)我如何启动一个进程并告诉它不要高举控制台窗口?

如果我已经监督了一个明显的解释,我提前道歉,但我在子流程文档和这个平台上都看了

-----更新-----

我应该补充一点,我试图用选定的浏览器启动IPython,但无法弄清楚如何让它工作

>ipython notebook --browser='C:\Program Files (x86)\Mozilla Firefox\Firefox.exe'
... 
[NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
...
**[NotebookApp] No web browser found: could not locate runnable browser.**
Run Code Online (Sandbox Code Playgroud)

确切地说,Windows命令提示符窗口中的以下命令按预期工作:

start firefox 
Run Code Online (Sandbox Code Playgroud)

ipython notebook --browser=firefox 
Run Code Online (Sandbox Code Playgroud)

不起作用(与上面相同的错误).

python windows subprocess ipython

45
推荐指数
5
解决办法
9万
查看次数

IPython - 缺少ipython_notebook_config.py

当我创建配置文件时,只创建了2个配置文件,而不是5个.

ipython profile create test_3

[ProfileCreate] Generating default config file: u'/root/.ipython/profile_test_3/ipython_config.py'
[ProfileCreate] Generating default config file: u'/root/.ipython/profile_test_3/ipython_kernel_config.py'
Run Code Online (Sandbox Code Playgroud)

我安装了2个版本的python,2.6.6和2.7.我已经为python创建了一个使用/usr/bin/python2.7的别名

我已经安装了easy_install和pip

使用pip安装的软件包的完整列表:

alabaster(0.7.6)appnope(0.1.0)Babel(2.0)backports.ssl-match-hostname(3.4.0.2)certifi(2015.4.28)decorator(4.0.2)Django(1.8.3)docutils(0.12) funcsigs(0.4)functools32(3.2.3.post2)gnureadline(6.3.3)ipykernel(4.0.3)ipyparallel(4.0.0) ipython(4.0.0)ipython-genutils(0.1.0) ipywidgets(4.0.2)Jinja2(2.8)jsonschema(2.5.1)jupyter-client(4.0.0)jupyter-core(4.0.2)MarkupSafe(0.23)matplotlib(1.4.3)mistune(0.7)mock(1.3. 0)nbconvert(4.0.0)nbformat(4.0.0)nose(1.3.7)notebook(4.0.1)numpy(1.9.2)numpydoc(0.5)pandas(0.16.2)path.py(7.6)pbr( 1.4.0)pexpect(3.3)pickleshare(0.5)pip(7.1.0)ptyprocess(0.5)Pygments(2.0.2)pyparsing(2.0.3)pyreadline(2.0)python-dateutil(2.4.2)pytz(2015.4) pyzmq(14.7.0)qtconsole(4.0.0)requests(2.7.0)scikit-learn(0.16.1)scipy(0.16.0)setuptools(18.1)simplegeneric(0.8.1)six(1.9.0)snowballstemmer( 1.2.0)Sphinx(1.3.1)sphinx-rtd-theme(0.1.8)terminado(0.5)testpath(0.2)tornado(4.2.1)traitlets(4.0.0)

我错过了什么吗?有人可以将我链接到ipython_notebook_config.py文件,以便我可以在默认配置文件中使用它吗?强制执行是错误的吗?

我已经从网上添加了一个ipython_notebook_config.py并对其进行了编辑......它似乎忽略了它.我正在指定端口8888,它的列表端口为8889.此外,我无法连接到那个笔记本.

ipython python-2.7

6
推荐指数
2
解决办法
4665
查看次数

标签 统计

ipython ×2

python ×1

python-2.7 ×1

subprocess ×1

windows ×1