Home > Backend Development > Python Tutorial > What are the keywords for importing other function libraries in python?

What are the keywords for importing other function libraries in python?

王林
Release: 2020-06-09 09:44:13
Original
8114 people have browsed it

What are the keywords for importing other function libraries in python?

The keyword for importing other function libraries in python is import.

For example, if we need to import a module now, we can use the import statement to introduce the module. The syntax is as follows:

import module1[, module2[,... moduleN]]
Copy after login

For example, if we want to reference the module math, we can use it at the beginning of the file. Use import math to introduce. When calling functions in the math module, they must be quoted like this:

模块名.函数名
Copy after login

When the interpreter encounters an import statement, the module will be imported if it is in the current search path.

Recommended tutorial: python tutorial

The above is the detailed content of What are the keywords for importing other function libraries 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