Home > Backend Development > Python Tutorial > How to create a module in python

How to create a module in python

藏色散人
Release: 2019-08-01 15:46:29
Original
5013 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template