5 种令人惊讶的使用 Jupyter 的方式
Jupyter

> 
> Jupyter 不仅仅是一个数据分析工具，让我们看看如何以最有创意的方式使用这个基于 Python 的软件。
> 
> 
> 


![](/data/attachment/album/202011/12/224138d99jlp3q5qjqv5v7.jpg)


[Jupyter](https://jupyter.org/) 项目提供了用 JupyterLab 和 Jupyter Notebook 等交互式编写软件的技术方式。这个软件通常用于数据分析，但你可能不知道（Jupyter 社区也没有想到），你可以用它做多少事情。


以下是我使用 Jupyter 的五大意想不到的创造性方法。


### 1、处理图像


在[图像编辑和处理](https://opensource.com/life/12/6/design-without-debt-five-tools-for-designers)方面，有很多很好的开源工具 —— 从那些可以与 Photoshop 媲美的工具到实验性的 [Glimpse](https://glimpse-editor.github.io/)。但即使有这么多选择，有时我还是不想离开 [Python](https://opensource.com/resources/python) 的世界。


幸运的是，Jupyter 是一个做轻量级图像处理的好选择。利用 Jupyter 直接将 [Pillow](https://pillow.readthedocs.io/en/stable/index.html) 对象显示为图像的优势，让你可以尽情地对图片进行实验。我甚至还用它给孩子[做了一个涂色画](https://opensource.com/article/20/8/edit-images-python)。


### 2、做一个 SSH 跳板遥控器


由于 JupyterLab 可以让你[上传和下载](https://jupyterlab.readthedocs.io/en/stable/user/files.html#uploading-and-downloading)文件、[编辑](https://jupyterlab.readthedocs.io/en/stable/user/files.html#opening-files)文件，甚至[运行终端](https://jupyterlab.readthedocs.io/en/stable/user/terminal.html)，所以它拥有制作 SSH 跳板环境所需的所有部件。


通过一些 SSH 转发魔法，你可以让 Jupyter 成为防火墙另一边的[远程控制台](https://opensource.com/article/20/8/remote-management-jupyter)。


### 3、开发 Web 应用程序


我最喜欢的使用 Jupyter 的方式之一是用于一种意想不到的软件开发。我[做了一次演讲](https://opensource.com/article/20/8/write-talk-using-jupyter-notebooks)，在演讲中，我使用 Jupyter Notebook 实时开发了一个 [Web 应用](https://github.com/moshez/interactive-web-development/blob/e31ae72d8cab7637d18bc734c4e8afc10c60251f/interactive-web-development.ipynb)。讲演的最后是一个简单的表单，它是 XSS 和 CSS 安全的，并包括一些轻量级的服务器端计算。


一个日常的 Jupyter 用户可能不会期望它是一个最棒的 Web 开发环境，但它是一个非常强大的环境。


### 4、从你喜欢的服务中提取报告


JupyterLab 中的数据分析是一种常见的用法，但<ruby> 自我提升分析 <rt>  self-improvement analysis </rt></ruby>呢？


你可以使用 Jupyter 来[分析你的日历](https://opensource.com/article/20/9/analyze-your-life-jupyter)。如果你最喜欢的服务允许 API 导出，甚至可以让你导出一个 CSV，你可以将这些与你的日历进行关联。如果你发现你在社交媒体上发帖的时候，你的日历上写着你应该和你的经理开会，那 Jupyter 也救不了你！


### 5、开发游戏


对于扩大对 Jupyter Notebook 的期望值，我最喜欢的方式是和孩子一起建立一个游戏。我之前写过这方面的文章，有一个使用 [PursuedPyBear](https://ppb.dev/) 和 Jupyter [编写游戏](https://opensource.com/article/20/5/python-games)的分步教程。


在试图弄清游戏机制时，这种迭代式的游戏开发方法特别有用。能够在游戏中途改变规则（对不起，我必须得这样做）是一个改变游戏规则的方法。


你甚至可以使用 IPywidgets 来修改数字参数，就像[这个视频](https://www.youtube.com/watch?v=JaTf_ZT7tE8)所示。


### 下载电子书


JupyterLab 和 Jupyter Notebooks 提供了一个不可思议的实验环境。[下载这本指南](https://opensource.com/downloads/jupyter-guide)，其中包含了以令人吃惊的方式使用 Jupyter 的教程。


你是如何以创造性的方式使用它的？在下面的评论中分享你的最爱。




---


via: <https://opensource.com/article/20/11/surprising-jupyter>


作者：[Moshe Zadka](https://opensource.com/users/moshez) 选题：[lujun9972](https://github.com/lujun9972) 译者：[wxy](https://github.com/wxy) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
The [Jupyter](https://jupyter.org/) project offers interactive ways to write software with technology like JupyterLab and Jupyter Notebook. This software is commonly used for data analysis, but what you might not know (and the Jupyter community didn't expect) is how many things you can do with it.

Here are my top five unexpected and creative ways to use Jupyter.

## 1. Manipulate images

There are great open source tools out there for [image editing and manipulation](https://opensource.com/life/12/6/design-without-debt-five-tools-for-designers)—from those that rival Photoshop to the experimental work of [Glimpse](https://glimpse-editor.github.io/). Even with all those options, sometimes I just don't want to leave the world of [Python](https://opensource.com/resources/python).

Luckily, Jupyter is a great option for doing light image manipulation. Taking advantage of the fact that Jupyter directly shows [Pillow](https://pillow.readthedocs.io/en/stable/index.html) objects as images lets you experiment with pictures as much as you want. I even used it to [make a coloring book page](https://opensource.com/article/20/8/edit-images-python) for my child.

## 2. Make an SSH jumpbox remote control

Since JupyterLab lets you [upload and download](https://jupyterlab.readthedocs.io/en/stable/user/files.html#uploading-and-downloading) files, [edit](https://jupyterlab.readthedocs.io/en/stable/user/files.html#opening-files) files, and even [run terminals](https://jupyterlab.readthedocs.io/en/stable/user/terminal.html), it has all the pieces necessary to make an SSH jumpbox environment.

With some SSH-forwarding magic, you can make Jupyter your [remote console](https://opensource.com/article/20/8/remote-management-jupyter) on the other side of a firewall.

## 3. Develop web applications


One of my favorite ways to use Jupyter is for an unexpected kind of software development. I [gave a talk](https://opensource.com/article/20/8/write-talk-using-jupyter-notebooks) where I developed a [web application in real time](https://github.com/moshez/interactive-web-development/blob/e31ae72d8cab7637d18bc734c4e8afc10c60251f/interactive-web-development.ipynb) using a Jupyter notebook. The talk concluded with a simple form that is XSS- and CSS-safe and included some light server-side computation.

A day-to-day Jupyter user may not expect it to be a great web development environment, but it's a remarkably powerful one.

## 4. Pull reports from your favorite services

Data analysis in JupyterLab is a common use, but what about self-improvement analysis?

You can use Jupyter to [analyze your calendar](https://opensource.com/article/20/9/analyze-your-life-jupyter). If your favorite services allow API export, or even let you export a CSV, you can correlate those against your calendar. If you find out that you were posting on social media when your calendar said you were supposed to be in a meeting with your manager, however, Jupyter can't do much to help you!

## 5. Develop games

My favorite way to expand the expectations of what I can accomplish in a Jupyter Notebook is by building a game with my child. I wrote about this previously, with a step-by-step tutorial on [writing a game](https://opensource.com/article/20/5/python-games) using [PursuedPyBear](https://ppb.dev/) and Jupyter.

This iterative approach to game development is especially helpful when trying to figure out game mechanics. It's a game-changer (sorry, I had to) to be able to change the rules mid-game.

You can even use IPywidgets to modify the numeric parameters, as [this video](https://www.youtube.com/watch?v=JaTf_ZT7tE8) shows.

[Download the eBook](https://opensource.com/downloads/jupyter-guide)

JupyterLab and Jupyter Notebooks offer an incredible environment for experimenting. [Download this guide](https://opensource.com/downloads/jupyter-guide) that contains tutorials on the surprising ways to use Jupyter.

How are you using it in creative ways? Share your favorites in the comments below.

## 1 Comment