code: def execfile(self, filename):
          
          source = open(filename, 'r').read()
          try:
              try:
                  name = filename.encode('ascii')
              except UnicodeEncodeError:
                  name = '<executed_script>'
              code = compile(source, name, "exec")
          except (OverflowError, SyntaxError):
              InteractiveConsole.showsyntaxerror(self, filename)
          else:
              self.runcode(code)
docs: Exec filename