You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I wanted to get, say, the Gen 4 sprite of Pikachu, my first instinct would be the following:
import pokebase as pb
pikachu = pb.pokemon("pikachu")
pikachu_sprite = pikachu.sprites.versions.generation-iv.front_default
However, notice that generation-iv has a hyphen. According to the python interpreter, that's a subtraction operator, and it throws an error because it doesn't know how to subtract iv.front_default (an object that doesn't exist) from pikachu.sprites.versions.generation (which also doesn't exist).
The simplest fix would probably be to change all generation calls to use underscores instead.
The text was updated successfully, but these errors were encountered:
Though, you'd need to specify a version group in between since generation-iv leads to diamond-pearl, platinum, and heartgold-soulsilver. For the version groups that have dashes, you'd have to use another getattr call.
If I wanted to get, say, the Gen 4 sprite of Pikachu, my first instinct would be the following:
However, notice that
generation-iv
has a hyphen. According to the python interpreter, that's a subtraction operator, and it throws an error because it doesn't know how to subtractiv.front_default
(an object that doesn't exist) frompikachu.sprites.versions.generation
(which also doesn't exist).The simplest fix would probably be to change all generation calls to use underscores instead.
The text was updated successfully, but these errors were encountered: