# 。 /usr/bin/env python
#-*-Coding:utf-8-*-
"""
Each py file has its own built-in function
Print (VARs ()) to view
If this module is a directory when you import the module, you need to create a __init__ file in it.
"""
#print (VARs ())
#常用的函数内置函数
Print (__name__) #如果是主文件, __name__ = "__main__", otherwise equal to module name
print (__doc__) #没有则为None
Print (__file__) # Refers to the current file path with Os.path.dirname usage ratio large from
python11.bin import AA #aa在与bin同级的lib下面
print (aa.__package__) #当前文件为None, import additional files: Specify the package to which the file is located, with. Delimited.
print (aa.__cached__) #不加aa是当前文件的, and the current file is none. Otherwise, the other files
that are imported
#要求:
#在python11下面有两个同级文件, Lib and bin, require the OS module method to allow the current directory to be imported into the bin inside the AA
Import Sys,os
p1 = Os.path.dirname (Os.path.dirname (__file__)) #得到父级目录
p2 = "Bin" Result
= Os.path.join ( P1,P2) #拼接目录
Print (Result)
sys.path.append (Result) #添加到搜索路径的环境变量里面 to
i in Sys.path:
Print (i)
import AA
print (AA.F ()) #使用的时候要用模块名加点 (example: AA.F ())