Another use of the
dir()
command is to list the functions and variables available on each module we have loaded on Python. We will issue this command in the Python interpreter as follows:
>>> dir(samba) ['Ldb', 'MAX_NETBIOS_NAME_LEN', '_Ldb', '__builtins__', '__doc__', '__docformat__', '__file__', '__name__', '__package__', '__path__', '_glue', '_ldb', 'check_all_substituted', 'dn_from_dns_name', 'ensure_external_module', 'generate_random_password', 'get_debug_level', 'import_bundled_package', 'in_source_tree', 'interface_ips', 'is_valid_netbios_char', 'ldb', 'nttime2string', 'nttime2unix', 'os', 'param', 'read_and_sub_file', 'samba', 'set_debug_level', 'setup_file', 'source_tree_topdir', 'strcasecmp_m', 'strstr_m', 'substitute_var', 'sys', 'unix2nttime', 'valid_netbios_name', 'version']
So, we used the dir()
function by passing an argument with it (for example, samba
), and so the output was different. If we call it without passing arguments,...