问题:
I have the following folder structure. 我有以下文件夹结构。
application/app/folder/file.py
and I want to import some functions from file.py in another Python file which resides in 我想从位于另一个Python文件中的file.py导入一些功能
application/app2/some_folder/some_file.py
I've tried 我试过了
from application.app.folder.file import func_name
and some other various attempts but so far I couldn't manage to import properly. 和其他一些尝试,但到目前为止,我无法正确导入。 How can I do this? 我怎样才能做到这一点?
解决方案:
参考一: https://stackoom.com/question/IOMl/从其他文件夹导入文件参考二: https://oldbug.net/q/IOMl/Importing-files-from-different-folder
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/3224691