5
As far as I know it matters all the classes and functions of a certain file without having to reference it in the code, right? But I’m beginning to think from modulo import *
doesn’t mean that.
I was studying the Tkinter library and came across the following situation:
from tkinter import *
from tkinter import colorchooser
If in the first import
has already used the *
, why would I need to import the colorchooser
again? In fact apparently the colorchooser
nor was imported.
If I try to use the colorchooser
without using the second line it simply says it is not set. Why you need to import twice the colorchooser
?
I don’t know if I got it right, so when you import from a library, when you use *, it imports everything that’s in the file init.py of that folder? then Tkinter would not be a "Tkinter.py" file but a folder?
– Cachorro_louco
The asterisk in the case we’re talking about, will matter the
__init__.py
package (folder)tkinter
if he exists. But the asterisk itself imports the data only from the specified module, as I said in my reply https://answall.com/a/440593/157404– JeanExtreme002