0

thanks for taking the time to read this post. Basically I'm trying to call syntaxnet's parsey mcparseface from a subprocess. For some reason it wont run unless I change the working directory. I can run the subprocess with the following.

process = subprocess.Popen("./syntaxnet/demo.sh", cwd="/home/kahless/models/syntaxnet")

The problem is I also need my script to wait until parsey finishes. So I tried to use the wait command

process.wait()

But for some reason when using .wait() or .communicate() parsey mcparseface wont complete correctly.

Kahless
  • 1,213
  • 2
  • 13
  • 31
  • but when you do not `.wait()` or `.communicate()` it does work? Are you sure it is just not working and you only notice it when waiting for it to finish? – Tadhg McDonald-Jensen Sep 11 '16 at 17:47
  • Yea I know that it works because there is information being printed in the console and when I try .wait() it shows that it did not complete correctly. Is it possible that the .wait() command changes my cwd? – Kahless Sep 11 '16 at 17:53
  • What console is being printed to? Does python "show that it did not complete correctly." or something else? I'd expect there to be no output without specifying `stdout` and `stderr` to the `Popen` constructor. – Tadhg McDonald-Jensen Sep 11 '16 at 18:01
  • Sorry when I said console I meant terminal. When running demo.sh it prints output to the terminal it is running in. – Kahless Sep 11 '16 at 18:04
  • When I run demo.sh as a subprocess that same info is being printed to the terminal. – Kahless Sep 11 '16 at 18:05
  • Here's a link to the demo.sh code https://github.com/tensorflow/models/blob/master/syntaxnet/syntaxnet/demo.sh – Kahless Sep 11 '16 at 18:07
  • Are you asking if there is a python error code. If so there is not. The info being printed is coming from syntaxnet – Kahless Sep 11 '16 at 18:20

0 Answers0