forces new code to load/run : Module : Language Basics PYTHON examples


PYTHON examples » Language Basics » Module »

 

forces new code to load/run




#//File: changer.py

message = "First version"

def printer():
    print message



#////////////////////////////////////////////////////////////////////////////////
#//File: Main.py


import changer
changer.printer()

import changer
changer.printer()      # no effect: uses loaded module

reload(changer)        # forces new code to load/run
changer.printer()      # runs the new version now

           
       



Leave a Comment / Note


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


PYTHON examples

 Navioo Language Basics
» Module