def run_script(scriptfile):
 try:
  f = open(scriptfile, mode='r')
 except Exception:
  return
 mpstate.console.writeln(('Running script %s' % scriptfile))
 for line in f:
  line = line.strip()
  if ((line == '') or line.startswith('#')):
   continue
  if line.startswith('@'):
   line = line[1:]
  else:
   mpstate.console.writeln(('-> %s' % line))
  process_stdin(line)
 f.close()

def run_script ( scriptfile ) : try : f = open ( scriptfile , mode = 'r' ) except Exception : return mpstate . console . writeln ( ( 'Running script %s' % scriptfile ) ) for line in f : line = line . strip ( ) if ( ( line == '' ) or line . startswith ( '#' ) ) : continue if line . startswith ( '@' ) : line = line [ 1 : ] else : mpstate . console . writeln ( ( '-> %s' % line ) ) process_stdin ( line ) f . close ( )
run a script file .