# my_module.py # 被用于调用测试 def hello(): print("hello")
解释器内部使用的方法
my_module1 = __import__("my_module") my_module1.hello() # hello
官方建议使用方式
import importlib module2 = importlib.import_module("my_module") module2.hello() # hello
以上两种方式效果相同
2023-02-21 07:47:15 阅读次数:139
# my_module.py # 被用于调用测试 def hello(): print("hello")
my_module1 = __import__("my_module") my_module1.hello() # hello
import importlib module2 = importlib.import_module("my_module") module2.hello() # hello
以上两种方式效果相同
linux服务器安装pip命令
【python基础】学习路线
【后端】【语言】【python】python常见操作
【python】python 打印时间 python打印程序运行时间
【python C结构体】Python Ctypes结构体指针处理(函数参数,函数返回)
Blender下使用python设置骨骼旋转
Python 打包——过去、现在与未来
Python 中 -m 的典型用法、原理解析与发展演变
python编程入门(适合初学者)
python实战三:使用循环while模拟用户登录
文章
31240
阅读量
4466468
2025-03-11 09:34:07
2025-03-05 09:24:43
2025-03-05 09:23:32
2025-03-04 09:05:20
2025-02-26 07:20:25
2025-02-26 07:20:01
2023-03-16 07:49:58
2024-09-24 06:30:08
2023-04-25 10:20:57
2023-04-13 09:31:09
2023-06-07 07:31:52
2023-02-21 03:02:11