给定完整路径,如何导入模块? - How to import a module given the full path?

问题:

How can I load a Python module given its full path? 给定完整路径,如何加载Python模块? Note that the file can be anywhere in the filesystem, as it is a configuration option. 请注意,该文件能够在文件系统中的任何位置,由于它是配置选项。 spa


解决方案:

参考一: https://stackoom.com/question/Hap/给定完整路径-如何导入模块
参考二: https://oldbug.net/q/Hap/How-to-import-a-module-given-the-full-path
相关文章
相关标签/搜索