code: def run_file(self, session, filename):
          
          try:
              with open(filename, "r") as filep:
                  for lineno, line in enumerate(filep):
                      line = line.strip()
                      if not line or line.startswith("#"):
                          # Ignore comments and empty lines
                          continue
  
                      # Print out the executed line
                      session.write_line("[{0:02d}] >> {1}", lineno, line)
  
                      # Execute the line
                      if not self.execute(line, session):
                          session.write_line(
                              "Command at line {0} failed. Abandon.", lineno + 1
                          )
                          return False
  
                  session.write_line("Script execution succeeded")
          except IOError as ex:
              session.write_line("Error reading file {0}: {1}", filename, ex)
              return False
  
          return None
docs: Runs the given "script" file