Import custom .py files in Jupyter Notebook for Anaconda3

末鹿安然 提交于 2021-01-28 03:03:57

问题


Where do I store custom .py files for Anaconda3 on Mac, so that I can import them as packages in Jupyter Notebook?


回答1:


You can store them anywhere if you insert

import os
import sys
sys.path.append(os.path.abspath("path/to/module.py"))

from module import * 


来源:https://stackoverflow.com/questions/50293427/import-custom-py-files-in-jupyter-notebook-for-anaconda3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!