Import a specific member from a module : Module : Language Basics PYTHON examples


PYTHON examples » Language Basics » Module »

 

Import a specific member from a module




#//File: module1.py

def printer(x):           # module attribute
    print x

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


from module1 import printer       # copy out one variable
printer('Hello world!')           # no need to qualify name

           
       



Leave a Comment / Note


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


PYTHON examples

 Navioo Language Basics
» Module