blob: bcf5bf4fc76eace5a1987c07e6ad44a428f9a338 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
"""Execute files of Python code."""
import os, sys
def run_python_file(filename):
mod_globals = {
'__name__': '__main__',
'__file__': filename,
}
sys.path[0] = os.path.dirname(filename)
execfile(filename, mod_globals)
|