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 '---'
pr
Hi,
I want to create some powers in my fight program.
I want to know if dictionnaries is the best solution to do it.
For now its look like this :
//French name and description, don't care about it ;)
power1= {}
power1['Name'] = 'Flammes infernales'
power1['Description'] = 'Embrase lenemi et le
Hi i would like to display all the field of my powerAll like this :
Choose a power :
Froid devorant : Embrase lenemi et le feu bruler
Flammes infernales : 'Gele lenemi sur place
-
class Character():
def ChoosePouvoirUnique(self):
print ("Choose a power")
devorant', 'Gele lenemi sur place')]
hero1 = Character("Klaitos")
hero1.ChoosePouvoirUnique()
im *WANT to display this* :
Froid devorant : Gele lenemi sur place
Flammes infernales : Embrase lenemi et le feu bruler
I don't know how to get this ? :(
2011/2/24 Steven D
It's works. Thank you all.
2011/2/25 bob gailer
> On 2/24/2011 4:54 PM, Christopher Brookes wrote:
>
> Hi i would like to display all the field of my powerAll like this :
>
> Choose a power :
> Froid devorant : Embrase lenemi et le feu bruler
> Flammes infernale
Hi, is there a better way to do this ? (*heros are Character*)
herosAll = [
Character(0,"Chris","Soldat fort",type[0],15,5,8,50,1),
Character(1,"Antaa","Soldat moins fort",type[0],15,5,8,50,1)]
def HeroExist(HerosName):
herosId = -1
for heros in herosAll:
if HerosName
st print. You are using double quotes
> around the string so you can just type the single quote directly
>
> print ( "This hero doesn't exist')
>
> Alan G.
>
> 2011/2/25 Alan Gauld
>
>> "Christopher Brookes" wrote
>>
>> Hi, is there a
Hi,
Is there in Python private/protected attributes in class like in other
langage ?
--
Brookes Christopher.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
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
gt; for heros in herosAll:
>> heros.DisplayCharacterInfos()
>>
>> herosAll = [
>> Character(1,"Antaa","Soldat moins fort",15,5,8),
>> Character(2,"Klaitos","Soldat moins fort",15,5,8)]
>>
>> Character.Dis
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 a
11 matches
Mail list logo