Gerson, this has nothing to do with references. The code in "a.py" is executed once when it's named on the commandline (inside a module called '__main__') and then again when 'import a' is executed (inside a module called 'a') Jeff