की उपप्रक्रिया में बिल्ली आदेश पर अमल, popen() मैं आदेश से नीचे चल रहा हूँ तो अजगर महान परिणाम लौटने है ..अजगर
result_aftermatch= subp.Popen('ls -lrt', stdout=subp.PIPE,stderr=subp.PIPE,shell=True)
लेकिन उसी तरह से मैं फ़ाइल से greping लाइनों की आवश्यकता है कोड के साथ नीचे के रूप में है ...
list_of_id=[23,34,56,77,88]
result_aftermatch= subp.Popen('egrep','list_of_IDs','/home/bimlesh/python/result.log', stdout=subp.PIPE,stderr=subp.PIPE,shell=True)
result_lines,result_err= result_aftermatch.communicate()
print result_lines
कोड से ऊपर नीचे के रूप में त्रुटि दे रहा है ...
Traceback (most recent call last):
File "test.py", line 144, in <module>
result_aftermatch= subp.Popen('egrep','list_of_IDs','/home/bimlesh/python/result.log', stdout=subp.PIPE,stderr=subp.PIPE,shell=True)
File "/usr/lib/python2.6/subprocess.py", line 573, in __init__
raise TypeError("bufsize must be an integer")
TypeError: bufsize must be an integer
कृपया मदद करें।
मैं नीचे दिए गए कोड की कोशिश की ... –