# first file global variable variable = [] def f(stuff): global variable f = stuff # second file import firstfile firstfile.f("blah") variable = firstfile.variable print variable