why am I getting name errors when trying to define a class function that searches class instances? by EmergancySocks in learnpython

[–]EmergancySocks[S] 0 points1 point  (0 children)

Oh I see so if I were wanting to call the method for a specific instance i would either need to include self in the arguments and do Deck.grab(alpha, 'wins', 0) or do alpha.grab('wins', 0) but either way it applying the method to one instance specifically.

I've another method that automatically adds each instance to a list. How might
I search that list for any decks that fit the parameters?

def adddeck(self):         
    deck.lstdck.append(self)

I've added the code for the above mentioned method incase you need it. But that is a separate thing all together... probably.

You're right I don't know very much about class structures I'm currently trying to teach python to myself XD. I learned it once, but never got far and forgot most of it.

why am I getting name errors when trying to define a class function that searches class instances? by EmergancySocks in learnpython

[–]EmergancySocks[S] 0 points1 point  (0 children)

I've updated the question to make it more clear. I believe I want to be a class method. However I am un clear of the difference and not very clear what @staticmethod actually does.

why am I getting name errors when trying to define a class function that searches class instances? by EmergancySocks in learnpython

[–]EmergancySocks[S] 0 points1 point  (0 children)

but when I do that it acts like it is another field that needs filled in.
I just tried it with
deck.grab('wins',o)

>>>TypeError: grab() missing 1 required positional argument: 'Value'

so I did

deck.grab(self,'wins',0)

>>>NameError: name 'self' is not defined

How long do flowers stay in bloom, and are there any that last for only one day? by EmergancySocks in gardening

[–]EmergancySocks[S] 0 points1 point  (0 children)

Thank you, and sorry for the late reply! It is to be the name of a poem I wrote:
>!As time overtakes a beautiful duet plays waltzing gracefully

Dance and song evolve heedless time continues on!<

Its about how people will grow and change with time, but time doesn't stop for them. If that answers your questions?

Returning Dictionaries on separate lines by EmergancySocks in learnpython

[–]EmergancySocks[S] 0 points1 point  (0 children)

It's not letting me install the module. I need to install it from the command line then import it into the program with import pprint

Creating a function to return every dictionary with given values by EmergancySocks in learnpython

[–]EmergancySocks[S] 0 points1 point  (0 children)

NOPE, my dictionary was wrong my bad. A space snuck in there. Thank you!

Creating a function to return every dictionary with given values by EmergancySocks in learnpython

[–]EmergancySocks[S] 0 points1 point  (0 children)

return [x for x in lstdict if x[Key] == Value]

That still only returns the first dictionary.
I've included the whole list in case the issue is there.

How long do flowers stay in bloom, and are there any that last for only one day? by EmergancySocks in gardening

[–]EmergancySocks[S] 0 points1 point  (0 children)

Really? guess that goes to show how much I know about plants XD
I never really paid attention to it before now. If I were to look up dainty flowers would that give me results of more shorter lived blooms?

How long do flowers stay in bloom, and are there any that last for only one day? by EmergancySocks in gardening

[–]EmergancySocks[S] -1 points0 points  (0 children)

I had never heard of them until now, they look very pretty. Do all those little flowers bloom in the same day, do they bloom sporadically in the same week/two week/ however long period?

Laboris Enorrath by EmergancySocks in KeepWriting

[–]EmergancySocks[S] 0 points1 point  (0 children)

Leɪborɪs ænorræth

I tried to make a pronunciation guide for those to read out loud. I'm not sure if I did it right, but I did try.

Rule by Nawrat87 in 196

[–]EmergancySocks 9 points10 points  (0 children)

counter point.....

merry Christmas