zoukankan      html  css  js  c++  java
  • Site-specific configuration

    Site-specific configuration

      site.py会被自动导入。通过-S选项可阻止此行为。

      Importing this module will append site-specific paths to the module search path and add a few builtins.

    1、四个目录。

      It starts by constructing up to 4 directories from a head and a tail part. For the head part, it uses sys.prefix and sys.exec_prefix; empty heads are skipped. For the tail part, it uses the empty string and then lib/site-packages (on Windows) or lib/pythonX.Y/site-packages and then lib/site-python (on Unix and Macintosh). For each of the distinct head-tail combinations, it sees if it refers to an existing directory, and if so, adds it to sys.path and also inspects the newly added path for configuration files.

    2、.pth文件。

      A path configuration file is a file whose name has the form name.pth and exists in one of the four directories mentioned above; its contents are additional items (one per line) to be added to sys.path. Non-existing items are never added to sys.path, and no check is made that the item refers to a directory rather than a file. No item is added to sys.path more than once. Blank lines and lines beginning with # are skipped. Lines starting with import (followed by space or tab) are executed.

  • 相关阅读:
    [BZOJ 2144]跳跳棋
    [NOIp 2015]信息传递
    [JLOI 2014]松鼠的新家
    [Luogu 2062]分队问题
    [Luogu 2090]数字对
    [NOIp 2015]运输计划
    [USACO 03FEB]Farm Tour
    [TJOI 2010]中位数
    IO密集型 计算密集型
    python 编码
  • 原文地址:https://www.cnblogs.com/tekka/p/4546923.html
Copyright © 2011-2022 走看看