Re: [Tutor] command counter

2014-09-05 Thread Dave Angel
Crush Wrote in message: > My code is as follows... > > count = 0 > while count < 3: > count += 1 >subprocess.Popen('command') > if count == 3: > sys.exit() > > The line beginning "subp" is indented further than the one before it, so this script would terminate with an indentation erro

[Tutor] command counter

2014-09-05 Thread Bo Morris
Here is the shell script I am trying to recreate in python. Sorry for not posting this with my other emails...I am a bit off today. restart_count=10 count=10 restart=5 while ((count--)); do avconv -v verbose -re -analyzeduration 0 | ./bmdplay -m 2 -f pipe:0 echo "Retry" if [[ $count = 1

[Tutor] command counter

2014-09-05 Thread Crush
My code is as follows... count = 0 while count < 3: count += 1 subprocess.Popen('command') if count == 3: sys.exit() 'command' is any command. For testing, I have been using the command 'xterm' just so I can see it opening. As far as error and pertaining to the above code, if I close the

Re: [Tutor] command counter

2014-09-05 Thread Dave Angel
Bo Morris Wrote in message: > > subprocess.Popen("command") && add 1 to count. If count equals n number, do something. > I have tried count = 0 count += 1, but count does not seem to be > incrementing. It would be much better to post the code that "does not seem..." There are many possi

[Tutor] command counter

2014-09-05 Thread Bo Morris
I think I figured it out... each time I run subprocess.Popen("command"), I also have to count += 1, which adds 1 to count each time the command is run. Is this correct, or is there a better way? Thanks ___ Tutor maillist - Tutor@python.org To unsubscr

[Tutor] command counter

2014-09-05 Thread Bo Morris
how would I keep track of count for each time a command exectuted? for example... subprocess.Popen("command") && add 1 to count. If count equals n number, do something. I have tried count = 0 count += 1, but count does not seem to be incrementing. Thanks