What are the keywords for python import modules?

Release: 2020-04-16 13:22:49
Original
8807 people have browsed it

What are the keywords for python import modules?

When using Python for programming, some functions do not have to be implemented by yourself. You can use Python's existing standard library or third-party libraries provided by others.

The keyword for importing modules in Python is import.

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.

After the module is defined, we can use the import statement to introduce the module. The syntax is as follows:

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

Example:

# 导入sys整个模块 import sys # 使用sys模块名作为前缀来访问模块中的成员 print(sys.argv[0])
Copy after login

Recommendation:Python graphics and text Tutorial

The above is the detailed content of What are the keywords for python import modules?. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!