Reputation: 374
I thought it meant everything in the module. But in tkinter I would have to specifically import things like messagebox, colorchooser and filedialog despite having a "from tkinter import *" command. So exactly what does "import *" mean?
Upvotes: 1
Views: 12039
Reputation: 4716
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
Upvotes: 6
Reputation: 471
from module import *
This imports all names except those beginning with an underscore (_).
read more: Python modules
Upvotes: -3
Reputation: 629
It just means that you import all(methods, variables,...) in a way so you don't need to prefix them when using them.
Upvotes: -1