Re: [Tutor] Multiples python files

2011-03-01 Thread Christopher Brookes
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

Re: [Tutor] Multiples python files

2011-02-28 Thread 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"(?) solution to your problem is to store the list of characters inside the Character clas

Re: [Tutor] Multiples python files

2011-02-28 Thread Izz ad-Din Ruhulessin
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

Re: [Tutor] Multiples python files

2011-02-28 Thread Christopher Brookes
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

Re: [Tutor] Multiples python files

2011-02-28 Thread 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 herosAll list to the DisplayAll() method like this > > class Character(): > @classmethod > def DisplayAll(herosAll): >

Re: [Tutor] Multiples python files

2011-02-28 Thread Izz ad-Din Ruhulessin
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

[Tutor] Multiples python files

2011-02-28 Thread Christopher Brookes
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