What does python’s import mean?
__import__() function is used to dynamically load classes and functions.
If a module changes frequently, you can use __import__() to dynamically load it.
Recommended: [Python Tutorial]
Grammar
##__import__ Syntax:__import__(name[, globals[, locals[, fromlist[, level]]]])
#!/usr/bin/env python #encoding: utf-8 import os print ('在 a.py 文件中 %s' % id(os))
#!/usr/bin/env python #encoding: utf-8 import sys __import__('a') # 导入 a.py 模块
在 a.py 文件中 4394716136
The above is the detailed content of What does python's import mean?. For more information, please follow other related articles on the PHP Chinese website!