給定完整路徑,如何導入模塊? - 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
相關文章
相關標籤/搜索