[Tutor] question about object oriented programming and inheritance using datetime module

2007-01-15 Thread tpc
hey guys, I've been experimenting with Python's datetime module, and I created a function that, given a person's birthdate, calculates how old that person is. Now I want to create a class called age_calculator that does much the same thing. My class inherits from the date class, but I have to ty

[Tutor] try except continue

2005-07-28 Thread tpc
hey guys, so I've been trying to get my head around the try except statement in Python, and ideally what I'd like is for my procedural program, when it runs through its steps and encounters an error, to log the error and pick up where it left off and keep going. According to this link, 'continue'

[Tutor] inexplicable MySQLdb behavior, INSERT data doesn't appear

2005-04-19 Thread tpc
hi all, while recently trying to insert some data into the following table: # stores unique course definitions CREATE TABLE adminCourses ( ID TINYINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, Code CHAR(6), Title VARCHAR(55), Units TINYINT UNSIGNED ) TYPE = InnoDB; I got a 1L value when I ran

Re: [Tutor] strange hotshot error

2005-03-15 Thread tpc
version is 2.3.5 (#2, Feb 9 2005, 00:38:15) [GCC 3.3.5 (Debian 1:3.3.5-8)] >>> print "python lib is", python lib is >>> print distutils.sysconfig.get_python_lib(standard_lib=True) /usr/lib/python2.3 >>> print "System path is:", sys.path System path is: [&

[Tutor] strange hotshot error

2005-03-15 Thread tpc
hi everyone, to anyone who has profiled their Python code using hotshot; I designed a test case using hotshot that is basically a stripped down version of the example code found here: http://www.python.org/doc/current/lib/hotshot-example.html So I tried using the example code verbatim to see if I