python - Are these statements equivalent?: import package vs from package import * -


this question has answer here:

are these statements equivalent?:

import math , from math import *

import math means have put math (name of module) before use it, e.g. print(math.pi).

with using from math import *, python loading functions , variables math (or specified in __all__ exact) local namespace , can use them without module name prefix: print(pi).

hope helps!


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -