Having a mare with Classes

Graeme Matthew graeme.matthew at unite.com.au
Wed Feb 13 06:19:32 EST 2002


Please can someone help, im having an absolute mare, I have Wesley Chuns 
book on core python programming and I cannot get casses to work, im just 
using a simple test from the examples in the book.

OK I HAVE A CLASS PERSON

class Person:

     def printName(self):
         print 'You printed it'

I HAVE A SCRIPT:

#!/usr/local/bin/Python2.2


import sys

sys.path.append('/www/cgi-bin')

import Person
person = Person()

person.printName()

I keep on getting this error:

#! /usr/local/bin/Python2.2


TypeError: call or non function (type module)

Please if you can help it would be much appreciated.

Thanks graeme




More information about the Python-list mailing list