Import a pre-defined module : Module : Language Basics PYTHON examples


PYTHON examples » Language Basics » Module »

 

Import a pre-defined module




#//File: module1.py

def printer(x):           # module attribute
    print x

#/////////////////////////////////////////////////////////////////////////////
#//Main.py

import module1                    # get module as a whole
module1.printer('Hello world!')   # qualify to get names

           
       



Leave a Comment / Note


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


PYTHON examples

 Navioo Language Basics
» Module