Modules are Used to Define Things : Module : Introduction PYTHON TUTORIALS


PYTHON TUTORIALS » Introduction » Module »

 

Modules are Used to Define Things


A Simple Module Containing a Function 

# c:pythonhello2.py
def hello():
    print "Hello, world!"

You can then import it like this:

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



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Introduction
» Module