从其余文件夹导入文件 - Importing files from different folder

问题:

I have the following folder structure. 我有如下文件夹结构。 app

application/app/folder/file.py ide

and I want to import some functions from file.py in another Python file which resides in 我想从位于另外一个Python文件中的file.py导入一些功能 this

application/app2/some_folder/some_file.py spa

I've tried 我试过了 .net

from application.app.folder.file import func_name code

and some other various attempts but so far I couldn't manage to import properly. 和其余一些尝试,但到目前为止,我没法正确导入。 How can I do this? 我怎样才能作到这一点? get


解决方案:

参考一: https://stackoom.com/question/IOMl/从其余文件夹导入文件
参考二: https://oldbug.net/q/IOMl/Importing-files-from-different-folder
相关文章
相关标签/搜索