python subprocess block

Posted by MW on Stack Overflow See other posts from Stack Overflow or by MW
Published on 2010-05-04T23:44:53Z Indexed on 2010/05/04 23:58 UTC
Read the original article Hit count: 330

Filed under:
|
|
|
|

Hello.

I'm having a problem with the module subprocess. I'm running a script from python through:

subprocess.Popen('./run_pythia.sh',shell=True).communicate()

and sometimes it just blocks and it doesn't finish to execute the script. Before I was using .wait() instead of .communicate() but then because of this:

http://dcreager.net/2009/08/06/subprocess-communicate-drawbacks/

I changed to .communicate(). Nevertheless the problem continues.

Can anyone help me?

© Stack Overflow or respective owner

Related posts about python

Related posts about subprocess