code: def call(args):
      
      b = StringIO()
      p = subprocess.Popen(args,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.STDOUT)
      encoding = getattr(sys.stdout, 'encoding', None) or 'utf-8'
      # old python has bug in p.stdout, so the following little
      # hack is required.
      for stdout in iter(p.stdout.readline, ''):
          if len(stdout) == 0:
              break
          # translate non unicode to unicode
          stdout = force_unicode(stdout, encoding)
          # StringIO store unicode
          b.write(stdout)
          # stdout require non unicode
          sys.stdout.write(from_unicode(stdout, encoding))
          sys.stdout.flush()
      buf = b.getvalue()
      p.stdout.close()
      return p.returncode or 0, buf
docs: Call terminal command and return exit_code and stdout
  
      Parameters
      ----------
      args : list
          A command and arguments list
  
      Returns
      -------
      list : [exit_code, stdout]
          exit_code indicate the exit code of the command and stdout indicate the
          output of the command