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]]
Example:
# 导入sys整个模块 import sys # 使用sys模块名作为前缀来访问模块中的成员 print(sys.argv[0])
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!