Re: [Tutor] Vol 127, Issue 15

2014-09-05 Thread Steven D'Aprano
On Fri, Sep 05, 2014 at 05:32:34PM -0400, Crush wrote: > Ok nevermind, I did not figure it out. My code... You say "Never mind", which normally means the problem is solved, but then you say it doesn't do what you want. So do you want help or not? :-) > count = 0 > while count < 3: > count

Re: [Tutor] Vol 127, Issue 15

2014-09-05 Thread Alan Gauld
On 05/09/14 23:11, Alan Gauld wrote: Let's translate that to Python count = 1 error = subprocess.Popen('command') # execute once oops, that should be subprocess.call() sorry. while error and count < 3: # if error and less than 3 error = subprocess.call('command') # on succ

Re: [Tutor] Vol 127, Issue 15

2014-09-05 Thread Alan Gauld
On 05/09/14 22:32, Crush wrote: count = 0 while count < 3: count += 1 Subprocess.Popen('command') This is not real code since 'command' is presumably not the real command and subprocess is not spelled with an 'S'... Its usually better to post real code. if count == 3: sys.exit

Re: [Tutor] Vol 127, Issue 15

2014-09-05 Thread Marc Tompkins
On Fri, Sep 5, 2014 at 2:32 PM, Crush wrote: > Ok nevermind, I did not figure it out. My code... > > count = 0 > while count < 3: > count += 1 > Subprocess.Popen('command') > if count == 3: > sys.exit() > > This does not work as I want it to; it consecutively executes the command > t

Re: [Tutor] Vol 127, Issue 15

2014-09-05 Thread Cameron Simpson
On 05Sep2014 17:32, Crush wrote: Ok nevermind, I did not figure it out. My code... count = 0 while count < 3: count += 1 Subprocess.Popen('command') if count == 3: sys.exit() This does not work as I want it to; it consecutively executes the command three times in a row. I only want

[Tutor] Vol 127, Issue 15

2014-09-05 Thread Crush
Ok nevermind, I did not figure it out. My code... count = 0 while count < 3: count += 1 Subprocess.Popen('command') if count == 3: sys.exit() This does not work as I want it to; it consecutively executes the command three times in a row. I only want it to execute once. However, if t