ipython_IPython笔记本

ipython

Last PyCon US (2013) I attended, there were many interesting talks, but if I had to talk about what’s happening, what’s the trend, between other things I would mention IPython Notebook.

我参加的上一届PyCon US(2013)上有很多有趣的演讲,但是如果我不得不谈论正在发生的事情,趋势是什么,我还要提到IPython Notebook

In a few words: it’s an excellent tool, you can have an IPython console within your web browser where you can write code snippets and run them, and also render the results within the browser (not only text, also graphics, plots, rich media, etc). These code snippets are called “cells” and in addition you can add formatted text cells between your code cells. These text cells can be used to clarify, comment and explain your code, like you would read in a book.

简而言之:这是一个出色的工具,您可以在网络浏览器中拥有一个IPython控制台,您可以在其中编写代码段并运行它们,还可以在浏览器中呈现结果(不仅包括文本,图形,图解,富媒体)等)。 这些代码片段称为“单元”,此外,您可以在代码单元之间添加格式化的文本单元。 这些文本单元格可用于澄清,注释和解释您的代码,就像在书中读到的那样。

Moreover, you can save your notebooks in files, they are saved with an ipynb file extension. Basically it stores your code and text in a json format. Simple and powerful.

此外,您可以将笔记本保存为文件,它们以ipynb文件扩展名保存。 基本上,它以json格式存储您的代码和文本。 简单而强大。

So, why it’s so cool? There are many applications, for example, in the PyCon many of the presentations where made directly with an IPython Notebook. The speaker has his/her presentation previously created with an IPython notebook, it has text to describe things, and code that can be ran on the fly to show the audience how it works. Nice. Very nice for technical presentations (and decreases the chances to suffer a demo effect) .

那么,为什么这么酷? 例如,在PyCon中有许多应用程序,其中许多演示文稿都是使用IPython Notebook直接制作的。 演讲者的演讲以前是使用IPython笔记本创建的,其中包含用于描述事物的文字,以及可以实时运行以向听众展示其工作方式的代码。 真好 非常适合进行技术演示(并减少出现演示效果的机会)。

Not only for technical presentations, but for education, I’m thinking how useful could be for a teacher to use this tool to run code snippets with their students, and how clarifying for the students could be. In fact, I attended some tutorials at the PyCon that were taught with IPython Notebook, and as a “student” it was very useful and easy to follow, also I have the notebooks to look back at the code samples and modify or run them again.

我不仅在技术演示方面,而且在教育方面,我都在考虑教师使用此工具与学生一起运行代码片段有多大用处,以及对学生的澄清程度如何。 实际上,我参加了在PyCon上使用IPython Notebook进行教学的一些教程,并且作为“学生”,它非常有用且易于遵循,而且我还拥有笔记本可以回顾代码示例并再次修改或运行它们。

But, there’s more, I suppose you’re like every mortal who makes some trials (not tests, trials) to check if some snippet works as expected, try some ideas, do some proof of concept, play with stuff, check the results in an interactive way, etc. Some time ago, you would use a Python console. Then perhaps you started to use an IPython console, which gave you more introspection. Now, try using an IPython notebook, save your trials, and share with the rest of the team in your project. I think it’s an excellent tool to record trials, and let others to view and execute them; they could clarify much more how your code works. Also for you, when you have to go back to an ancient code, looking at your IPython notebooks would be a good way to refresh your memory.

但是,还有更多,我想您就像每个做过一些试验(而不是测试,试验)的凡人一样,检查某些代码片段是否按预期工作,尝试一些想法,做一些概念验证,玩弄东西,检查结果。交互方式等。前段时间,您将使用Python控制台。 然后,也许您开始使用IPython控制台,这使您有了更多的自省。 现在,尝试使用IPython笔记本,保存您的试用版,并与项目中的其他团队共享。 我认为这是记录试验并让其他人查看和执行试验的绝佳工具; 他们可以进一步阐明代码的工作方式。 同样对于您来说,当您必须返回到古老的代码时,查看IPython笔记本将是刷新内存的好方法。

Personally, for my projects, I’m starting to have a separate directory within the project for my “trials” with my IPython notebooks, as one would have another directory for “tests”.

就个人而言,对于我的项目,我开始在项目中为IPython笔记本的“试用版”建立一个单独的目录,因为一个目录将具有另一个“测试”目录。

翻译自: https://www.pybloggers.com/2013/06/ipython-notebook/

ipython

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值