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

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

[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] 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
her a point is on a line. >>> So I have to be misunderstanding your question. You must be asking >>> for a library function in OpenCV, and I'm pretty sure none of us are >>> OpenCV experts. >> >> >> Ok, found an OpenCV-specific answer about this: &

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

[Tutor] How to detect colinearity?

2014-09-05 Thread Danny Yoo
> But if you're think I'm expert with python because I'm work with computer > vision > I'm not I'm newbie to both.. Ok. Since you've stated that you are a beginner, we now have to recalibrate how we're answering your questions. In that case, I would strongly suggest going through a basic progra

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-05 Thread Marc Tompkins
On Fri, Sep 5, 2014 at 4:09 AM, Whees Northbee wrote: > I'm really sorry if my post doesn't appropriate to the forum rule.. I > already asked in other forums 2 months ago, but no answer or had voted down > and closed.. It's not that you've broken a rule. It's just that you're asking on a forum w

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-05 Thread Steven D'Aprano
On Fri, Sep 05, 2014 at 06:09:45PM +0700, Whees Northbee wrote: > I'm really sorry if my post doesn't appropriate to the forum rule.. I > already asked in other forums 2 months ago, but no answer or had voted down > and closed.. It's not a matter about breaking some rule, but about you getting an

Re: [Tutor] How to count vehicle? I'm trying but my code don't increasing..

2014-09-05 Thread Whees Northbee
I'm really sorry if my post doesn't appropriate to the forum rule.. I already asked in other forums 2 months ago, but no answer or had voted down and closed.. If you ask me about the basic slope formula or basic theory of intersection of point with a line I know, that's why I try with "if" code sin