python – What exactly does from module import * mean?

python – What exactly does from module import * mean?

A module can define an __all__ variable: a list containing the names that will be imported when you do from module import *. Anything not in this list will not actually be imported.
https://docs.python.org/2/tutorial/modules.html

It just means that you import all(methods, variables,…) in a way so you dont need to prefix them when using them.

python – What exactly does from module import * mean?

from module import *

This imports all names except those beginning with an underscore (_).

read more:
Python modules

Leave a Reply

Your email address will not be published. Required fields are marked *