常用操作 · 5月 11, 2022 0

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

内容纲要

写入到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

%d 博主赞过: