Thank you all for answers. Again.
2011/2/28 Alan Gauld
>
> "Christopher Brookes" wrote
>
>
> I don't understand
>>
>> @classmethod
>> def DisplayAll(cls, herosAll):
>>
>> What is cls ?
>>
>
> This is one of the advanced techniques I referred to a few days ago.
>
> Basically the "best"(?) sol
"Christopher Brookes" wrote
I don't understand
@classmethod
def DisplayAll(cls, herosAll):
What is cls ?
This is one of the advanced techniques I referred to a few
days ago.
Basically the "best"(?) solution to your problem is to store the
list of characters inside the Character clas
You can only call methods on a class without instantiating it, if it are
classmethods.
http://pyref.infogami.com/classmethod
2011/2/28 Christopher Brookes
> I don't understand
>
> @classmethod
> def DisplayAll(cls, herosAll
> ):
>
> What is cls ?
>
> 2011/2/28 Izz ad-Din Ruhulessin
>
>> @c
I don't understand
@classmethod
def DisplayAll(cls, herosAll):
What is cls ?
2011/2/28 Izz ad-Din Ruhulessin
> @classmethod
> def DisplayAll(herosAll):
>
> is of course:
>
> @classmethod
> def DisplayAll(cls, herosAll):
>
> 2011/2/28 Izz ad-Din Ruhulessin
>
> Hi, you must pass the
@classmethod
def DisplayAll(herosAll):
is of course:
@classmethod
def DisplayAll(cls, herosAll):
2011/2/28 Izz ad-Din Ruhulessin
> Hi, you must pass the herosAll list to the DisplayAll() method like this
>
> class Character():
> @classmethod
> def DisplayAll(herosAll):
>
Hi, you must pass the herosAll list to the DisplayAll() method like this
class Character():
@classmethod
def DisplayAll(herosAll):
print ('There is', Character.CharacterCount, 'heros')
for heros in herosAll:
heros.DisplayCharacterInfos()
herosAll = [
Character
Hi, first sorry for my poor english, i'm a french guy, i'm trying to make
the best :(
I would like to split my python script into multiples files.
I want :
A file which contains only class creations and methods,
A file with some personals functions
And a main.py which is the main script.
But i'm