重用来自不同 IPython 笔记本的代码 [英] Reusing code from different IPython notebooks

查看:28
本文介绍了重用来自不同 IPython 笔记本的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 IPython 并希望从另一个笔记本运行功能(无需在不同笔记本之间剪切和粘贴它们).这可能并且相当容易做到吗?

I am using IPython and want to run functions from one notebook from another (without cutting and pasting them between different notebooks). Is this possible and reasonably easy to do?

推荐答案

您可以使用 qtconsole 连接到同一个内核.只需在启动时提供:

You can connect with a qtconsole to the same kernel. Just supply this at startup:

ipython qtconsole --existing kernel-0300435c-3d07-4bb6-abda-8952e663ddb7.json

查看长字符串启动笔记本后的输出.

Look at the output after starting the notebook for the long string.

这篇关于重用来自不同 IPython 笔记本的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆