网络编程
位置:首页>> 网络编程>> Python编程>> python 打印出所有的对象/模块的属性(实例代码)

python 打印出所有的对象/模块的属性(实例代码)

作者:jingxian  发布时间:2023-09-02 21:46:15 

标签:python,打印,对象

实例如下:


import sys

def print_all(module_):
 modulelist = dir(module_)
 length = len(modulelist)
 for i in range(0,length,1):
   print getattr(module_,modulelist[i])

print_all(sys)
0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com