Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:59

0001 import shlex as _shlex
0002 import subprocess as _subprocess
0003 
0004 
0005 def pipe(cmdline, input = None):
0006   """
0007   wrapper around subprocess to simplify te interface
0008   """
0009   args = _shlex.split(cmdline)
0010   if input is not None:
0011     command = _subprocess.Popen(args, stdin = _subprocess.PIPE, stdout = _subprocess.PIPE, stderr = None)
0012   else:
0013     command = _subprocess.Popen(args, stdin = None, stdout = _subprocess.PIPE, stderr = None)
0014   (out, err) = command.communicate(input)
0015   return out