How to tell what methods are available in a installed module

How to tell what methods are available in a installed module

If I do a&nbsp;<code>print(dir(pychromecast))</code>&nbsp;at a Python prompt, I get the list at the bottom of this message. Which of the methods are supposed to work? Because some do, like&nbsp;<code>pychromecast.get_device_status()</code>&nbsp;But others like&nbsp;<code>_get_chromecast_from_host</code>&nbsp;or&nbsp;<code>get_chromecasts</code>throw an attribute error like:

If I do a print(dir(pychromecast)) at a Python prompt, I get the list at the bottom of this message. Which of the methods are supposed to work? Because some do, like pychromecast.get_device_status() But others like _get_chromecast_from_host or get_chromecaststhrow an attribute error like:

AttributeError: module 'pychromecast' has no attribute 'get_chromehosts'

Is it that I am doing/understanding something fundamentally wrong? Does the _ before the name play into it?

As promised, here is the output of dir:

['APP_BACKDROP', 'APP_DASHCAST', 'APP_MEDIA_RECEIVER', 'APP_PLEX',
 'APP_SPOTIFY', 'APP_YOUTUBE', 'CAST_TYPES', 'CAST_TYPE_CHROMECAST',
 'Chromecast', 'ChromecastConnectionError', 'ControllerNotRegistered',
 'DeviceStatus', 'IDLE_APP_ID', 'IGNORE_CEC', 'LaunchError',
 'MultipleChromecastsFoundError', 'NoChromecastFoundError', 'NotConnected',
 'PyChromecastError', 'PyChromecastStopped', 'STREAM_TYPE_BUFFERED', 
 'UnsupportedNamespace', '_LOGGER', '__all__', '__builtins__', '__cached__',
 '__doc__', '__file__', '__loader__', '__name__', '__package__', 
 '__path__', '__spec__', '__version__', '__version_info__', 
 '_get_chromecast_from_host', '_get_chromecast_from_service', 
 'cast_channel_pb2', 'config', 'controllers', 'dial', 
 'discover_chromecasts', 'discovery', 'error', 'fnmatch', 'get_app_config', 
 'get_chromecasts', 'get_device_status', 'get_possible_app_ids', 'json', 
 'logging', 'reboot', 'requests', 'socket_client', 'start_discovery',
 'stop_discovery', 'threading']


python

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Basic Data Types in Python | Python Web Development For Beginners

In the programming world, Data types play an important role. Each Variable is stored in different data types and responsible for various functions. Python had two different objects, and They are mutable and immutable objects.

How To Compare Tesla and Ford Company By Using Magic Methods in Python

Magic Methods are the special methods which gives us the ability to access built in syntactical features such as ‘<’, ‘>’, ‘==’, ‘+’ etc.. You must have worked with such methods without knowing them to be as magic methods. Magic methods can be identified with their names which start with __ and ends with __ like __init__, __call__, __str__ etc. These methods are also called Dunder Methods, because of their name starting and ending with Double Underscore (Dunder).

Python Programming: A Beginner’s Guide

Python is an interpreted, high-level, powerful general-purpose programming language. You may ask, Python’s a snake right? and Why is this programming language named after it?

Hire Python Developers

Are you looking for experienced, reliable, and qualified Python developers? If yes, you have reached the right place. At **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")**, our full-stack Python development services...

Python any: How to Check If Element is Iterable or Not

Python any() function returns True if any element of an iterable is True otherwise any() function returns False. The syntax is any().