Re: subprocess exiting in an incomprehensible fashion

2005-10-22 Thread Will
Well, I'll be damned... Thank you very much. I'm still getting a little tripped up with blocking IO and whatnot, but I think I can work that out. This was a real help, thanks again. #!/usr/bin/python # -*- coding: UTF-8 -*- import subprocess import random import re import os import time import se

Re: subprocess exiting in an incomprehensible fashion

2005-10-21 Thread Maciej Dziardziel
Will wrote: > After the first number is input, the subprocess is exiting after the > first communicate. I do not understand why. As help(calc.communicate) says: Read data from stdout and stderr, until end-of-file is reached. Wait for process to _terminate_. > Any help would be much appreciated.

subprocess exiting in an incomprehensible fashion

2005-10-21 Thread Will
I have this bit of code: #!/usr/bin/python import subprocess calc = subprocess.Popen("dc", stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) max = 5 for value in range(1, max): calcout, calcerr = calc.communic