class problem, NoneType obj has no attribute

globalrev skanemupp at yahoo.se
Fri May 16 07:36:08 EDT 2008


wassup here?


>>>
7

Traceback (most recent call last):
  File "C:\Python25\myPrograms\netflix\netflix.py", line 22, in
<module>
    print cust1.getID()
AttributeError: 'NoneType' object has no attribute 'getID'
>>>



class customer:
    def __init__(self, ID, movies):
        self.ID = ID
        self.movies = movies

    def getID():
        return self.ID

    def getMovies():
        return self.movies


import os
import customer
import movie

mv1 = open('C:\\Python25\\myPrograms\\netflix\\mv1exp2.txt', 'r+')
mv1str = mv1.read()

print mv1str.count(',5,')

cust1 = customer.__init__('12',['1','435','2332'])
print cust1.getID()



More information about the Python-list mailing list