Python新增模組載入路徑
在Python安裝目錄下的\Lib\site-packages新增一個.pth字尾檔案,如mypk.pth,檔案中配置模組路徑,可多個路徑,每行一個
例如: 模組路徑 e:\dbaop\test\a.py, 使用 import test.a直接寫路徑
在mypk.pth中增加一行"e:\dbaop"
sys函式
import sys; sys.path.append("e:\dbaop")
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26250550/viewspace-1847237/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- python中如何新增模組匯入路徑?Python
- Python模組查詢路徑Python
- Python實現模組熱載入Python
- Python 模組的載入順序Python
- 為.Net專案新增動態庫載入路徑
- python-模組入門二(模組迴圈匯入,區分python檔案的兩種用途,模組搜尋路徑,軟體開發的目錄規範)Python
- Nodejs教程12:path(路徑)模組NodeJS
- swiper 模組載入
- python下載模組Python
- swoole 模組的載入
- Python入門—time模組Python
- Python 模組匯入方式Python
- ABP - 模組載入機制
- Helloworld 驅動模組載入
- onthink新增模組
- 探索 React Native 的 bundle 載入路徑React Native
- QT 檔案相對路徑載入QT
- Python入門(二十六):檔案模組(os模組與shutil模組)Python
- 讀懂CommonJS的模組載入JS
- nodejs模組載入分析(1).mdNodeJS
- Abp vNext 模組載入機制
- OrchardCore 如何動態載入模組?
- Angular入門到精通系列教程(11)- 模組(NgModule),延遲載入模組Angular
- python之匯入模組的方法Python
- python如何匯入自定義模組Python
- 為 Nginx 新增模組Nginx
- apache新增php模組ApachePHP
- Nginx 新增 lua 模組Nginx
- python 模組:itsdangerous 模組Python
- Python模組:time模組Python
- 零基礎入門Python的路徑Python
- Android HAL模組的載入過程Android
- UEFI載入程式 & 驅動模組化
- 前端模組化之迴圈載入前端
- Python模組過載的五種方法Python
- vue render載入img的src路徑問題Vue
- 下載Python安裝包及支援包路徑Python
- Python基礎入門(8)- Python模組和包Python
- Python模組之urllib模組Python