import os buildroot = os.getcwd() os.chdir('inundation') print 'Changing to', buildroot execfile('test_all.py')