VSCode:如何将从Jupyter Notebook导入的python文件导出回Jupyter格式? [英] VSCode: How to export a python file that was imported from a Jupyter Notebook back to Jupyter format?

查看:955
本文介绍了VSCode:如何将从Jupyter Notebook导入的python文件导出回Jupyter格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能是一个愚蠢的问题,但我找不到. Visual Studio代码编辑器提供了一种非常好的方法来与Jupyter笔记本一起使用.我可以直接在vscode中编辑单元格并运行它们.现在,使用版本控制将很容易.

Probably a silly question, but I couldn't find it. Visual Studio Code editor has a really nice way to work with Jupyter Notebooks. I can edit the cells directly in vscode and run them. Now it would be easy to work with version control.

但是我找不到将其转换回笔记本的方法!如何从生成的python文件生成笔记本?

But I couldn't find a way to convert it back to a Notebook! How do I generate a notebook back from the generated python file?

我知道笔记本中没有输出单元.

I understand that the notebook wouldn't have the output cells in it.

推荐答案

交互式Python窗口中有一个具有笔记本输出的选项:

There is an option in the interactive Python window that has the notebook output:

这真的很酷,现在您可以在Python文件中工作,并且与版本配置系统(Git)的界面非常好.

This is really cool, now you can work in a Python file and have a really nice interface with your version configuration system (Git).

是的,这是一个愚蠢的问题:-)

Yes, it was a silly question :-)

这篇关于VSCode:如何将从Jupyter Notebook导入的python文件导出回Jupyter格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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