How to View the List of Functions in a Python Module

After importing a module into a Python script, you need to know the list of available functions to use them effectively. Remembering all of them is impossible, which can be a real time-waster for programmers.

Fortunately, Python provides an easy way to view the list of all functions contained in a module through its built-in help. The process is straightforward.

Viewing the List of Functions in a Module

Simply type the name of the module followed by a dot.

how to view the list of functions

Then, wait a few seconds without pressing enter.

A list of all the functions within the module should appear.

how to display the list of functions in a Python module

This allows you to find the function you need without having to search through the module's documentation.

Selecting a Function

Navigate through the list using the arrow keys on your keyboard.

Once you find the function you are interested in, select it and press enter.

selecting a function

The function will then appear in the command line of your console or editor.

the selected function

However, you still need to understand the parameters that the function requires.

Identifying the Function's Parameters

To see the list of parameters for a function, open a parenthesis after the function name.

After a few seconds, the online help will display the list of parameters.

list of parameters

Note: In this example, the atan() function has only one input parameter, a numerical value x.

Now, enter the function's parameters and close the parenthesis. Then press enter.

If you are using the Python interpreter console, the result of the function will be displayed immediately.

final result

If you are using a script editor (like IDLE), you can be confident that you have written the function with the correct syntax.

This method allows you to use the functions in Python modules without needing to memorize them all.

 
 

Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

FacebookTwitterLinkedinLinkedin
knowledge base

Python Modules