Modules in Python
S.Madhumalar
Assistant Professor
C.P.A College, Bodinayakanur
What are Modules?
More on Modules
Executing Modules
The Module Search Path
“Compiled” Python Files
Some Tips
Standard Modules
>>> sys.s1
‘>>> ‘
>>> sys.s1 = ‘c> ‘
c> print ‘Hello’
Hello
c>
The dir() Function
>>> dir(mod)
[‘_name_’, ‘m1’, ‘m2’]
Packages
Importing * From a Package
import sound.effects.surround
from sound.effects import *
Intra-package References
from sound.effects import echo
Packages in Multiple Directories