Ah! Got it. i have been looking at your code and i notice this:
the problem is that you dont need to
print it becuase the printing is done INSIDE the method, so for this just delete the print statement and just have:
class add:
def __init__(self, name):
self.name = name
def Hi(self):
print self.name, "just joined"
while True:
i = raw_input("command>")
if i.split()[0] == 'add':
p = add(i.split()[1])
p.Hi() #dont print a function that does not return anything
else:
print "no"
The only times in which you can PRINT a function is when it returns something, in this case the function p.Hi() didnt return anything so the value None was given.
Hope that helps.
Reputation Points: 264
Solved Threads: 183
Veteran Poster
Offline 1,095 posts
since May 2008