zoukankan      html  css  js  c++  java
  • Import Search Path

     
    >>> import sys
    >>> sys.path
    [
    '', 'C:\\Python26\\python26.zip', 'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C
    :\\Python26\\lib\\plat-win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\P
    ython26\\lib\\site
    -packages']
    >>> sys
    <module 'sys' (built-in)>
    >>> sys.path.append('D:\svnTest')
    >>> sys.path
    [
    '', 'C:\\Python26\\python26.zip', 'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C
    :\\Python26\\lib\\plat-win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\P
    ython26\\lib\\site
    -packages', 'D:\\svnTest']

    Notes:

    1. Importing the Sys module makes all of its functions and attributes available
    2. You can add a new directory to Python's search path at runtime by appending the directory name to sys.path, and then Python will look in that directory as well, whenever you try to import a module. The effect lasts as long as Python is running.
    Work for fun,Live for love!
  • 相关阅读:
    PHP乘法表
    通过闭包可以返回局部变量
    FZU2125_简单的等式
    FZU2122_又见LKity
    FZU2121_神庙逃亡
    UVA12585_Poker End Games
    UVA12583_Memory Overow
    HDU4647_Another Graph Game
    HDU4646_Laser Beam
    HDU4787_GRE Words Revenge
  • 原文地址:https://www.cnblogs.com/allenblogs/p/1803510.html
Copyright © 2011-2022 走看看