On 24-Feb-11 08:13, James Reynolds wrote:
I don't understand what you are trying to do?
I'm assuming def GetAllAtrib is a method within a class; perhaps you
could copy more the code base?
It seems to be locating the three elements you have in that method just
fine, but I'm guessing you have another print statement somewhere that
is causing it to print None.
Or perhaps calling the method from an IDE or interactive prompt, where
the print statements in the method are printing as intended, but the
interactive environment itself is printing the return value from the
method? This could happen if you did this at the prompt:
>>> print object.GetAllAtrib()
This is a case where giving us more information about what you're doing
helps us answer your question better.
--steve
On Thu, Feb 24, 2011 at 10:48 AM, Christopher Brookes
<[email protected] <mailto:[email protected]>> wrote:
Hi, i'm new in python.
I'm trying to create a small fight program in object.
I've created __init__ (its works) but when i'm trying to display
init param i'm getting param and "None" every time. Why ?
def GetAllAtrib(self):
print '-----------------------------------------------'
print self.name <http://self.name>
print self.description
print self.type
print '-----------------------------------------------'
give ->>
-----------------------------------------------
Klaitos
Soldier very strong
Soldier
-----------------------------------------------
*None *<<<<<<<<-- WHY ARE U HERE ??
Yours,
--
Brookes Christopher.
_______________________________________________
Tutor maillist - [email protected] <mailto:[email protected]>
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
--
Steve Willoughby / [email protected]
"A ship in harbor is safe, but that is not what ships are built for."
PGP Fingerprint 48A3 2621 E72C 31D9 2928 2E8F 6506 DB29 54F7 0F53
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor