[Tutor] Looking for suggestions for improving chessTimer.py code

bob gailer bgailer at alum.rpi.edu
Tue Oct 30 16:55:57 CET 2007


I also encourage you to jump into classes. Yes there is a learning 
curve. It is IMHO worth it.

Borrowing from Kent Johnson:

class Player(object):
   def __init__(self, name, moveCounter, remainingTime):
     self.name = name
     self.moveCounter = moveCounter
     self.remainingTime = remainingTime


Note I capitalized the class name. That's the Python "style".

Also refer to the class-based code I wrote for you a week or 2 ago. That 
should help you.





More information about the Tutor mailing list