5.1 How to introduce modules
Using the keyword import in Python to introduce a module, such as referencing module math, can be introduced with import math at the very beginning of the file. When you call a function in the math module, you must refer to this:
Module name. function name
Sometimes we just need to use a function in the module, we just need to introduce the function, at this point we can pass the statement
From Module name Import function name 1, function name 2 ....
5.2 How to define your own modules
In Python, each Python file can be used as a module whose name is the name of the file.
For example, there is a file test.py that defines the function add in test.py:
#test. Pydef Add (b): return a+b
In other files, you can import test first, then call it through Test.add (A, B), and of course, by using the From test import Add. (Example from http://www.cnblogs.com/dolphin0520/archive/2013/03/19/2969152.html)
Python Learning series----Fifth module