python - raise child_exception , OSError: [Errno 2] No such file or directory -


import sys,os import subprocess import pdb  pdb.set_trace() findcmd = 'find . -name "pcapdump0"' print os.getcwd() print findcmd out = subprocess.popen(findcmd,stdout=subprocess.pipe) (stdout, stderr) = out.communicate() filelist = stdout.decode().split() print filelist 

i getting error

traceback (most recent call last): file "generatepcap.py", line 10, in <module> out = subprocess.popen(findcmd,stdout=subprocess.pipe) file "/usr/lib/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) file "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child raise child_exception oserror: [errno 2] no such file or directory 

simply means says: popen can't find command specified, because did not split string.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -