Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from guizero import App, Text, TextBox, PushButton, Picture
- from pokebase import pokemon
- import webbrowser
- from requests import get
- from PIL import Image
- from io import BytesIO
- app = App(title='Pokemon Fetcher', width=500, height=500)
- weightdisplay = "test"
- print(weightdisplay)
- welcome = Text(app, text="Which Pokemon do you want to fetch?")
- def fetch_pokemon():
- global weightdisplay
- name = input_box.value
- poke = pokemon(name)
- pic = get(poke.sprites.front_default).content
- image = Image.open(BytesIO(pic))
- image.save('poke.gif')
- icon.value = 'poke.gif'
- weight = Text(app, str(poke.weight) + " Weight")
- weightdisplay = poke.weight
- print(weightdisplay)
- height = Text(app, str(poke.height) + " Height")
- input_box = TextBox(app)
- submit = PushButton(app, text='Fetch', command=fetch_pokemon)
- icon = Picture(app, image="poke.gif")
- app.display()
- print(weightdisplay)
Add Comment
Please, Sign In to add comment