parameters: (command, execute_in='', use_shell=None, use_tee=None,
                   _with_python = 1, **env )
return_statement: return st
docstring: Return (status,output) of executed command.
  
      .. deprecated:: 1.17
          Use subprocess.Popen instead
  
      Parameters
      ----------
      command : str
          A concatenated string of executable and arguments.
      execute_in : str
          Before running command ``cd execute_in`` and after ``cd -``.
      use_shell : {bool, None}, optional
          If True, execute ``sh -c command``. Default None (True)
      use_tee : {bool, None}, optional
          If True use tee. Default None (True)
  
  
      Returns
      -------
      res : str
          Both stdout and stderr messages.
  
      Notes
      -----
      On NT, DOS systems the returned status is correct for external commands.
      Wild cards will not work for non-posix systems or when use_shell=0.
docstring_summary: Return (status,output) of executed command.
docstring_tokens: Return ( status output ) of executed command .
function: def exec_command(command, execute_in='', use_shell=None, use_tee=None,
                   _with_python = 1, **env ):
      """
      Return (status,output) of executed command.
  
      .. deprecated:: 1.17
          Use subprocess.Popen instead
  
      Parameters
      ----------
      command : str
          A concatenated string of executable and arguments.
      execute_in : str
          Before running command ``cd execute_in`` and after ``cd -``.
      use_shell : {bool, None}, optional
          If True, execute ``sh -c command``. Default None (True)
      use_tee : {bool, None}, optional
          If True use tee. Default None (True)
  
  
      Returns
      -------
      res : str
          Both stdout and stderr messages.
  
      Notes
      -----
      On NT, DOS systems the returned status is correct for external commands.
      Wild cards will not work for non-posix systems or when use_shell=0.
  
      """
      # 2019-01-30, 1.17
      warnings.warn('exec_command is deprecated since NumPy v1.17, use '
                    'subprocess.Popen instead', DeprecationWarning, stacklevel=1)
      log.debug('exec_command(%r,%s)' % (command,
           ','.join(['%s=%r'%kv for kv in env.items()])))
  
      if use_tee is None:
          use_tee = os.name=='posix'
      if use_shell is None:
          use_shell = os.name=='posix'
      execute_in = os.path.abspath(execute_in)
      oldcwd = os.path.abspath(os.getcwd())
  
      if __name__[-12:] == 'exec_command':
          exec_dir = os.path.dirname(os.path.abspath(__file__))
      elif os.path.isfile('exec_command.py'):
          exec_dir = os.path.abspath('.')
      else:
          exec_dir = os.path.abspath(sys.argv[0])
          if os.path.isfile(exec_dir):
              exec_dir = os.path.dirname(exec_dir)
  
      if oldcwd!=execute_in:
          os.chdir(execute_in)
          log.debug('New cwd: %s' % execute_in)
      else:
          log.debug('Retaining cwd: %s' % oldcwd)
  
      oldenv = _preserve_environment( list(env.keys()) )
      _update_environment( **env )
  
      try:
          st = _exec_command(command,
                             use_shell=use_shell,
                             use_tee=use_tee,
                             **env)
      finally:
          if oldcwd!=execute_in:
              os.chdir(oldcwd)
              log.debug('Restored cwd to %s' % oldcwd)
          _update_environment(**oldenv)
  
      return st
function_tokens: def exec_command ( command , execute_in = '' , use_shell = None , use_tee = None , _with_python = 1 , * * env ) : # 2019-01-30, 1.17 warnings . warn ( 'exec_command is deprecated since NumPy v1.17, use ' 'subprocess.Popen instead' , DeprecationWarning , stacklevel = 1 ) log . debug ( 'exec_command(%r,%s)' % ( command , ',' . join ( [ '%s=%r' % kv for kv in env . items ( ) ] ) ) ) if use_tee is None : use_tee = os . name == 'posix' if use_shell is None : use_shell = os . name == 'posix' execute_in = os . path . abspath ( execute_in ) oldcwd = os . path . abspath ( os . getcwd ( ) ) if __name__ [ - 12 : ] == 'exec_command' : exec_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) elif os . path . isfile ( 'exec_command.py' ) : exec_dir = os . path . abspath ( '.' ) else : exec_dir = os . path . abspath ( sys . argv [ 0 ] ) if os . path . isfile ( exec_dir ) : exec_dir = os . path . dirname ( exec_dir ) if oldcwd != execute_in : os . chdir ( execute_in ) log . debug ( 'New cwd: %s' % execute_in ) else : log . debug ( 'Retaining cwd: %s' % oldcwd ) oldenv = _preserve_environment ( list ( env . keys ( ) ) ) _update_environment ( * * env ) try : st = _exec_command ( command , use_shell = use_shell , use_tee = use_tee , * * env ) finally : if oldcwd != execute_in : os . chdir ( oldcwd ) log . debug ( 'Restored cwd to %s' % oldcwd ) _update_environment ( * * oldenv ) return st