def preprocess_file(filename, cpp_path='cpp', cpp_args=''):
 path_list = [cpp_path]
 if isinstance(cpp_args, list):
  path_list += cpp_args
 elif (cpp_args != ''):
  path_list += [cpp_args]
 path_list += [filename]
 try:
  pipe = Popen(path_list, stdout=PIPE, universal_newlines=True)
  text = pipe.communicate()[0]
 except OSError as e:
  raise RuntimeError((("Unable to invoke 'cpp'.  " + 'Make sure its path was passed correctly\n') + ('Original error: %s' % e)))
 return text

def preprocess_file ( filename , cpp_path = 'cpp' , cpp_args = '' ) : path_list = [ cpp_path ] if isinstance ( cpp_args , list ) : path_list += cpp_args elif ( cpp_args != '' ) : path_list += [ cpp_args ] path_list += [ filename ] try : pipe = Popen ( path_list , stdout = PIPE , universal_newlines = True ) text = pipe . communicate ( ) [ 0 ] except OSError as e : raise RuntimeError ( ( ( "Unable to invoke 'cpp'.  " + 'Make sure its path was passed correctly\n' ) + ( 'Original error: %s' % e ) ) ) return text
preprocess a file using cpp .