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


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0