Python module
A module is a collection of functions and variables that have been bundled together in a single file.
working with the functions defined in modules
导入: import my_module 使用: my_module.some_function() 当模块名字太长时,导入: import my_module as m 使用: m.function1() 当模块包含的function太多,而只需使用其中几个时: from my_module import function1 使用: function1() 缺点是导入的这个function前不加模块前缀后,能被重写 导入所有function和object: from my_module import * 使用: function1() 缺点是会污染global namespace内部执行如下: