深度阅读

jupyter writefile魔术写法 快捷的文件写法

作者
作者
2023年08月22日
更新时间
3.34 分钟
阅读时间
0
阅读量

写入到python文件

%%writefile myfile.py
def my_function():
    print("Hello from a function")

这种方案对于写入配置文件和临时文件来说还是很简单的。

参考链接
Hack: How To Create Files From Jupyter
https://predictivehacks.com/hack-how-to-create-files-from-jupyter/
Built-in magic commands
https://ipython.readthedocs.io/en/stable/interactive/magics.html

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。