1
Septembers 2016 年 9 月 20 日
see https://docs.python.org/3/library/modules.html
(不认真看文档的打死好么? |
2
Geoion 2016 年 9 月 20 日
self.__class__.__name__
|
3
csdreamdong 2016 年 9 月 20 日
globals()
? |
4
Septembers 2016 年 9 月 20 日
|
5
hnsxyhh OP 是 python2.7 哦
|
6
Contextualist 2016 年 9 月 20 日 via iPad
3 楼正解, globals() 返回所有全局变量的 dict ,然后只需要逐个用 type() 筛出是 class 的变量就行了。
|
7
sheep3 2016 年 9 月 20 日
cat `find ./ -iname '*.py'` | egrep 'class\s+[a-zA-Z]+\('
|
8
hitmanx 2016 年 9 月 20 日 |
9
errorlife 2016 年 9 月 21 日
头像围观者:)
|
10
xrlin 2016 年 9 月 21 日
围观头像
|
11
hnsxyhh OP 谢谢大家,楼上几位的方法都试了, 8 楼的方案解决了
|