+ 4

Function of from ___ import *

Nothing special read question

8th Jun 2018, 12:34 AM
ᏳoƊoԲᎮc !
ᏳoƊoԲᎮc ! - avatar
4 Réponses
+ 8
Basically, it just says import everything. But even though they are fundamentally the same, there is a slight difference: When you type import [module] you have to type the module name then function name. Otherwise, you can just type the function name. Example: from math import * print(sqrt(25)) #5.0 import math print(math.sqrt(25)) #5.0 By the way, when using multiple modules it's not a good idea to put "from [module] import *" because you may have confusion amongst identically named functions in the different modules. I personally find it better to use "import [module]".
8th Jun 2018, 12:53 AM
blackcat1111
blackcat1111 - avatar
+ 4
blackcat1111 That asterisk But Y it is even there 🙁? Thanks
8th Jun 2018, 12:49 AM
ᏳoƊoԲᎮc !
ᏳoƊoԲᎮc ! - avatar
+ 3
If you're asking what this line does, it's exactly the same as import ____
8th Jun 2018, 12:48 AM
blackcat1111
blackcat1111 - avatar
+ 3
blackcat1111 Thanks I got it now😄👍
8th Jun 2018, 12:57 AM
ᏳoƊoԲᎮc !
ᏳoƊoԲᎮc ! - avatar