#encoding =utf-8
"""
Module:
1, import demo# all the functions under the demo.py, call method: Demo.function ()
2. Import function () function from demo import function () #从demo. py file
#调用用法: Function ()
3. From demo import all# if all is set under Demo.py file, all functions contained in the all variable are imported;
#可以将某些函数限定在本地使用
Set all as follows: __all__ = ["function"]
4, from the demo import * #导入demo. PY all functions
5. Package: (folder)
Create a new directory M1 in the project directory:
Must contain __init__.py, and then include demo.py,
The demo.py content of the new file under project directory is as follows;
Usage 1:
Import M1.demo as Demo
Print demo.function ()
Usage 2: Import the py file from the package
From M1 Import Demo
Print demo.function ()
Usage 3:
Import M1.demo
Print m1.demo.function ()
#方法四----to be tested, not yet.
From M1 Import *
#from M1 Import module_03
#print m1.__file__
Print Module_03.module_test ()
"""
def hash ():
Return 4
Python next module, package import