#//simple.py
print 'hello'
spam = 1
#///////////////////////////////////////////////////////////////////////////
#//Main.py
import simple # first import: loads and runs file's code
print simple.spam # assignment makes an attribute
simple.spam = 2 # change attribute in module
import simple # just fetches already-loaded module
print simple.spam # code wasn't rerun: attribute unchanged
|