Python get all the properties of an object

dir (obj)

 

Additional information is available: https://www.computationalimaging.cn/2020/01/method-to-get-all-attributes-of-python.html

 

E.g:

import autogluon as ag

you (ag)

 

[Output]:

['AutoGluonObject', 'AutoGluonWarning', 'BaseTask', 'Bool', 'Categorical', 'Choice', 'DataLoader', 'DeprecationHelper', 'Dict', 'EasyDict', 'ImageClassification', 'Int', 'List', 'NestedSpace', 'ObjectDetection', 'Queue', 'Real', 'SampledDataset', 'Space', 'SplitSampler', 'TabularPrediction', 'Task', 'TextClassification', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'absolute_import', 'args', 'autogluon_function', 'autogluon_object', 'autogluon_register_args', 'autogluon_register_dict', 'base', 'check_sha1', 'classproperty', 'collect_params', 'core', 'custom_queue', 'dataloader', 'dataset', 'decorator', 'defaultdict', 'deprecate', 'download', 'edict', 'file_helper', 'files', 'func', 'generate_csv', 'get_cpu_count', 'get_data_rec', 'get_gpu_count', 'get_split_samplers', 'image_classification', 'in_ipynb', 'keydefaultdict', 'load', 'logging', 'make_deprecate', 'miscs', 'mkdir', 'mousover_plot', 'mxutils', 'obj', 'object_detection', 'optimizer', 'plot_network', 'plot_performance_vs_trials', 'plot_summary_of_models', 'plot_tabular_models', 'plots', 'raise_num_file', 'read_remote_ips', 'sagemaker_setup', 'sample_config', 'save', 'scheduler', 'searcher', 'serialization', 'space', 'sync_remote', 'tabular_prediction', 'task', 'text_classification', 'tqdm', 'try_import', 'try_import_catboost', 'try_import_cv2', 'try_import_lightgbm', 'try_import_mxboard', 'try_import_mxnet', 'unzip', 'update_params', 'util_decorator', 'utils', 'verbosity2loglevel', 'version', 'warning_filter']

Published 47 original articles · won praise 11 · views 20000 +

Guess you like

Origin blog.csdn.net/qazwsxrx/article/details/103956714