PythonPythonHOME和PYTHONPATH的區(qū)別

      網(wǎng)友投稿 1326 2025-03-31

      Python: PYTHONhome和PYTHONPATH的區(qū)別

      目錄

      PYTHONhome和PYTHONPATH的區(qū)別

      6.1.2.?The Module Search Path

      sys.path

      PYTHONHOME和PYTHONPATH的區(qū)別

      官方文檔解讀:https://docs.python.org/3/tutorial/modules.html

      6.1.2.?The Module Search Path

      When a module named?spam?is imported, the interpreter first searches for a built-in module with that name. If not found, it then searches for a file named?spam.py?in a list of directories given by the variable?sys.path.?sys.path?is initialized from these locations:

      The directory containing the input script (or the current directory when no file is specified).

      PYTHONPATH?(a list of directory names, with the same syntax as the shell variable?PATH).

      The installation-dependent default.

      當導入名為spam的模塊時,解釋器首先搜索具有該名稱的內(nèi)置模塊。如果沒有找到,它會搜索一個名為spam.py的文件。變量sys.path. sys給出的目錄列表中的py。路徑是從這些位置初始化的:

      包含輸入腳本的目錄(或未指定文件時的當前目錄)。

      PYTHONPATH(一個目錄名列表,與shell變量PATH具有相同的語法)。

      installation-dependent默認。

      Note:On file systems which support symlinks, the directory containing the input script is calculated after the symlink is followed. In other words the directory containing the symlink is?not?added to the module search path.

      Python: PYTHONHOME和PYTHONPATH的區(qū)別

      After initialization, Python programs can modify?sys.path. The directory containing the script being run is placed at the beginning of the search path, ahead of the standard library path. This means that scripts in that directory will be loaded instead of modules of the same name in the library directory. This is an error unless the replacement is intended. See section?Standard Modules?for more information.

      sys.path

      sys.path 包含輸入模塊的目錄名列表,并且當前目錄也是sys.path的一部分。

      Python

      版權(quán)聲明:本文內(nèi)容由網(wǎng)絡用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔相應法律責任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。

      版權(quán)聲明:本文內(nèi)容由網(wǎng)絡用戶投稿,版權(quán)歸原作者所有,本站不擁有其著作權(quán),亦不承擔相應法律責任。如果您發(fā)現(xiàn)本站中有涉嫌抄襲或描述失實的內(nèi)容,請聯(lián)系我們jiasou666@gmail.com 處理,核實后本網(wǎng)站將在24小時內(nèi)刪除侵權(quán)內(nèi)容。

      上一篇:apaas 架構(gòu)(apaas 架構(gòu)分析)
      下一篇:工廠生產(chǎn)自動化流程的技術(shù)路徑與實施步驟,詳細介紹化工廠自動化流程的技術(shù)路徑和實施步驟
      相關(guān)文章
      亚洲国产精品无码久久久不卡| 国产亚洲老熟女视频| 婷婷精品国产亚洲AV麻豆不片 | 久久久久国产成人精品亚洲午夜| 亚洲AV网站在线观看| 国产精品亚洲精品日韩动图| 国产精品国产亚洲区艳妇糸列短篇 | 91丁香亚洲综合社区| 亚洲情A成黄在线观看动漫软件| 亚洲欧洲精品国产区| 亚洲影视一区二区| 亚洲一区免费视频| 中文字幕精品三区无码亚洲| 亚洲AV日韩综合一区尤物| 亚洲精品精华液一区二区| 亚洲AV永久无码天堂影院| 色偷偷尼玛图亚洲综合| 亚洲av手机在线观看| 国产国拍亚洲精品福利| 亚洲韩国精品无码一区二区三区| 亚洲AV无码久久精品色欲| 亚洲激情中文字幕| 亚洲国产美女福利直播秀一区二区 | 亚洲综合精品网站| 亚洲精品无码不卡在线播HE | 久久久久亚洲AV片无码| 亚洲精品白色在线发布| 亚洲精品中文字幕麻豆| 日本亚洲精品色婷婷在线影院 | 久久久影院亚洲精品| 久久水蜜桃亚洲av无码精品麻豆 | 亚洲日本一区二区一本一道 | 亚洲日韩一页精品发布| 亚洲精品高清久久| 亚洲AV综合色区无码二区爱AV| 亚洲国产精品自在自线观看| 亚洲午夜无码片在线观看影院猛| 亚洲欧洲自拍拍偷午夜色无码| 亚洲av之男人的天堂网站| 亚洲精品中文字幕乱码| 亚洲一区欧洲一区|