現在、パッケージ内のすべての python ファイルのすべての名前と、ファイルに含まれるクラスのすべての名前を表示する python スクリプトを作成しています。
シナリオ
#A.py
class apple:
.
.
class banana:
.
.
# Extracting_FilesName_className.py
f=open("c:/package/A.py','r')
className=[]
"Here i need to use some command to get all the class name within the file A.py and append it to className'
print file_name,className
out put A.py,apple,banana
「class」文字列が存在するかどうかを行ごとに確認し、className を取得できる古い慣例の方法を使用できます。しかし、すべてのクラス Name を取得するより良い方法があることを知りたいですか?