[ale] 4 way timer

arxion arxaaron at gmail.com
Mon Feb 23 00:43:16 EST 2009


On 2009, Feb, 22, , at 11:23 PM, brobinso at tfn.net wrote:
>> [snip]
>> If you *always* start 2 after 1 and 3 after 2, etc., then you'd just
>> need two keys to have an N-way timer.  Hit, say, enter, to start
>> a new timer and stop the last one, and, say control-C to stop the
>> last timer and print all of the timings.
>
> I will need to go not necessarily in order.  I might go 1,3,2,4,1,3,2,
> each shutting off the previous timer.
>
> I'm trying to avoid writing it in python, since in the end, it'll  
> break,
> since I'm an amateur, and the fancier it looks, the more likely I  
> can sell
> it to professional scientists.
>

I think Python is an entirely professional and appropriate language for
this, as could be Basic, Perl, C, C++, Ruby, Java, JavaScript (with a  
web
page interface) or any of a couple dozen other languages, both compiled
and interpreted.

Python, because of WxPython, may offer a couple of advantages in  
simplicity,
readable examples and cross platform portability for a GUI interface.  
Combining
the cool (and simple) code that Ed Cashin so kindly whipped up for  
you with the
example "Stopwatch" WxPython code I found here (as the top hit from a  
google on
"python stopwatch"):  < http://wiki.wxpython.org/StopWatch >
I think you could make this a reliable, working tool in a matter of a
couple hours.  I know I could, and I'm a relative novice at python  
coding.

BTW, I tested the example Stopwatch code before I recommended here  
and it runs
AS IS on my Mac here -- OSeX 10.4 with (stock) python 2.3.5 run from  
shell as
  $> pythonw stopwatch.py
-- Adding a #!/usr/bin/pythonw shebang line to the top of the example  
and
setting execute permissions allows me to also run it as the direct  
shell command
  $> stopwatch.py
-- OR... setting the default app to Mac's "PythonLauncher.app",
I can just double click on the file to run it.

So use python and take advantage of the free examples that have just  
been
handed to you.  As you noted, we ALE'rs are smart... well.... OK...  
we just
look smart because we've been tinkering with this 'puter stuff for a  
long
time... but our suggestions are sound more often than not! :-)

peace
aaron





peace
aaron




More information about the Ale mailing list