Есть следующий код:
pipe = subprocess.Popen('./BashScript.sh', stdout = subprocess.PIPE, stderr = subprocess.PIPE)
logfile = open('log.txt', 'w')
tempstr = pipe.stdout.readline()
print tempstr
logfile.write(tempstr)
stdout_ret, stderr_ret = pipe.communicate()
Объясните пожалуйста, в чем проблема.