How to get all the method names of an object in Python.
print type(obj)
for x in inspect.getmembers(obj, inspect.ismethod):
print x[0]
Output example
<class 'nfc.tag.tt3_sony.FelicaStandard'>
__init__
__str__
_format
_is_present
authenticate
dump
dump_service
format
polling
protect
read_from_ndef_service
read_without_encryption
request_response
request_service
request_system_code
search_service_code
send_cmd_recv_rsp
write_to_ndef_service
write_without_encryption
He also introduced the method using dir in the comment.
for x in dir(obj):
print x, ':', type(eval("obj."+x))
Thank you for reading to the end. On Twitter, we also tweet technical material that is not written in Qiita, so please follow us if you like: relieved: → Twitter @ suin
Recommended Posts