基本的にオブジェクトの属性は
John.age
みたいに'.'つなぎで取得できるが、これが外部からimportしたものだったりすると、 「多分こういう属性があると思うんだけどその名前が分からない(いや、ひょっとしたら無いかも)」 という微妙な感じの状況に陥ることがある。
そういう場合ググるのが一番確実なのだが、ちょっと見てみたいという程度なら以下のようにすれば覗き見できるので覚えておいて損はないと思う。
例
import sys
print(sys)
# <module 'sys' (built-in)>
# これでは意味が分からないが・・・・
print( dir(sys) )
# ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__stderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_getframe', '_mercurial', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_clear', 'exc_info', 'exc_type', 'excepthook', 'exec_prefix', 'executable', 'exit', 'exitfunc', 'flags', 'float_info', 'float_repr_style', 'getcheckinterval', 'getdefaultencoding', 'getdlopenflags', 'getfilesystemencoding', 'getprofile', 'getrecursionlimit', 'getrefcount', 'getsizeof', 'gettrace', 'hexversion', 'last_traceback', 'last_type', 'last_value', 'long_info', 'maxint', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2', 'py3kwarning', 'real_prefix', 'setcheckinterval', 'setdlopenflags', 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', 'subversion', 'version', 'version_info', 'warnoptions']
# こうなっていればそれらしい属性名を発掘できるかも?