Re: [Tutor] Looking to improve my stopWatch.py

2007-10-25 Thread Kent Johnson
Dick Moores wrote: > I've also seen things like this: > >>> a = [] > >>> if not a: > ... print 'a is empty' > ... > a is empty > >>> > > Isn't this preferable?: > >>> a = [] > >>> if a == []: > ... print 'a is empty' > ... > a is empty I like the simplicity and consistency of if

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-25 Thread Dick Moores
At 12:17 AM 10/25/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > > Tim Peters ("Explicit is better than implicit"), isn't "if > > lapTimeFlag == > > > True" preferable? > > > >if (lapTimeFlag == True) == True: > > > > Well, how about "Readability counts"? > >Thats the

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-25 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > > Tim Peters ("Explicit is better than implicit"), isn't "if > lapTimeFlag == > > True" preferable? > >if (lapTimeFlag == True) == True: > > Well, how about "Readability counts"? Thats the point. By calling the variable a "Flag" you are implying t

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-25 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > I had absolutely no clue what mscrt was. The MicroSoftVisualCRunTime library. help ("curses") > > Whew! > There's quite a bit in that one! Yep its a full "Gui" toolkit for text based terminals. Fortunately you only need a couple of functions. Check

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread Dick Moores
At 09:41 PM 10/24/2007, John Fouhy wrote: On 25/10/2007, Dick Moores <[EMAIL PROTECTED]> wrote: >  I'm wondering about "if lapTimeFlag:". Following "The Zen of Python", by > Tim Peters ("Explicit is better than implicit"), isn't "if lapTimeFlag == > True" preferable? No :-) Otherwise, maybe we sh

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread John Fouhy
On 25/10/2007, Dick Moores <[EMAIL PROTECTED]> wrote: > I'm wondering about "if lapTimeFlag:". Following "The Zen of Python", by > Tim Peters ("Explicit is better than implicit"), isn't "if lapTimeFlag == > True" preferable? No :-) Otherwise, maybe we should make it even more explicit: if (la

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread Dick Moores
At 02:14 PM 10/24/2007, bob gailer wrote: Dick Moores wrote: Please give me constructive criticism of < http://www.rcblue.com/Python/stopWatchForWeb14-a.py>   1 - lapCounter is not used. Deleted. 2 - simplify:    if lapTimeFlag == False:    print "Total Time is", secs

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread bhaaluu
On 10/24/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "bhaaluu" <[EMAIL PROTECTED]> wrote > > import msvcrt > > Traceback (most recent call last): > > File "", line 1, in ? > > ImportError: No module named msvcrt > > > You are on Linux so you'll need to port it to use curses instead of

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote import msvcrt > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named msvcrt You are on Linux so you'll need to port it to use curses instead of msvcrt... Alan G __

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread bob gailer
Dick Moores wrote: > Please give me constructive criticism of > > 1 - lapCounter is not used. 2 - simplify: if lapTimeFlag == False: print "Total Time is", secsToHMS(totalTime) print

Re: [Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread bhaaluu
On 10/24/07, Dick Moores <[EMAIL PROTECTED]> wrote: > Please give me constructive criticism of > $ python Python 2.4.3 (#2, Oct 6 2006, 07:52:30) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" fo

[Tutor] Looking to improve my stopWatch.py

2007-10-24 Thread Dick Moores
Please give me constructive criticism of (secsToHMS() was perfected with much Tutor help in this thread: ) Thanks, Dick Moores 44 __