def execute_file(filename, **kw):
 if (filename == '-'):
  inp = sys.stdin
 else:
  inp = open(filename)
 kw['source'] = filename
 _execute_script(inp, **kw)

def execute_file ( filename , ** kw ) : if ( filename == '-' ) : inp = sys . stdin else : inp = open ( filename ) kw [ 'source' ] = filename _execute_script ( inp , ** kw )
execute commands from a file .