Modules are Programs : Module « Introduction « Python Tutorial






Any Python program can be imported as a module. 

# C:\python\hello.py
print "Hello, world!"


# C:\testModule.py

import sys
sys.path.append('c:/python')
import hello

modules are extensions that can be imported into Python to extend its capabilities. 
You import modules with a special command called import. 


import math 
print math.floor(32.9) 
print int(math.floor(32.9))








1.9.Module
1.9.1.Modules are Programs
1.9.2.To reload the simple module, you would use the following:
1.9.3.Modules are Used to Define Things
1.9.4.A Module with Conditional Test Code
1.9.5.Getting Help with __doc__
1.9.6.Find out the Source