Python module (Module) is a Python file, ending with .py, containing Python object definitions and Python statements.
Modules allow you to organize your Python code snippets logically.
Assigning related code to a module can make your code more usable and easier to understand.
Modules can define functions, classes and variables, and modules can also contain executable code.
How to create a module in python?
The following example is a simple module support.py:
support.py Module:
def print_func( par ): print "Hello : ", par return
Related recommendations: "Python Tutorial"
The above is the detailed content of How to create a module in python. For more information, please follow other related articles on the PHP Chinese website!