[Tutor] Difference between >>> import modulex and >>> from modulex import *?

hcohen2 hcohen2 at comcast.net
Sat Jan 3 12:34:08 EST 2004


Todd G. Gardner wrote:

>Hello Everyone,
>
>I have some questions that I must have skipped the answers in the tutorial.
>Pardon me if they are obvious.
>
>1) What is the difference between ">>> import modulex" and ">>> from modulex
>import *"?
>
>2) What happens when the command reads ">>> from modulex import something"?
>    2a) Is something a function that is imported from modulex?
>
>Thank in advance,
>
>Thank you,
>
>Todd
>
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>  
>
I think this will essentially repeat what was said, but perhaps more 
concisely:

In the first case you have imported every built in function of that module.

In the second you have only imported the specificly named function 
'from' that module.

In the first case you are free to execute every built in function from 
that module if you needed them.  In the second you are restricted to 
only the function you had imported.






More information about the Tutor mailing list