Home  >  Article  >  Backend Development  >  How to create a module in python

How to create a module in python

藏色散人
藏色散人Original
2019-06-27 09:41:194925browse

How to create a module in python

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn