Newbie on importing

Roger morris_r at
Fri Jun 20 20:19:10 CEST 2003

Around Fri,Jun 20 2003, at 02:11,  jwsacksteder at, wrote:
> That example is still less than clear...
> >import sys
> >
> >Imports the module named 'sys'.
> Which get me access to what in 'sys'?
> >from sys import *
> >
> >Imports all names from sys (including names referring to functions).
> Likewise, what additional thing are available when doing this? 
> Is 'import sys' a subset of 'from sys import *'?
import sys

To access a function 'blah', you would have to refer to it:

If you use like this:
from sys import *

Then to access the function blah, you would just refer to it:

If 'blah' is the only thing in sys you want, you could do this:
from sys import blah

morris_r at

More information about the Python-list mailing list