subprocess popen to run commands (HDFS/hadoop)
问题 I am trying to use subprocess.popen to run commands on my machine. This is what I have so far cmdvec = ['/usr/bin/hdfs', 'dfs', '-text', '/data/ds_abc/clickstream/{d_20151221-2300}/*', '|', 'wc', '-l'] subproc = subprocess.Popen(cmdvec, stdout=subprocess.PIPE, stdin=None, stderr=subprocess.STDOUT) If I run the command in my terminal I get an output of 15/12/21 16:09:31 INFO lzo.GPLNativeCodeLoader: Loaded native gpl library 15/12/21 16:09:31 INFO lzo.LzoCodec: Successfully loaded &