Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. import COVID19Py
  2. import tkinter as tk
  3. from tkinter import *
  4. import os
  5.                
  6. #################################################################
  7. covid19 = COVID19Py.COVID19()
  8. location = covid19.getLocationByCountryCode('PL')
  9. deaths = location[0]['latest']['deaths']
  10. confirmed = location[0]['latest']['confirmed']
  11. recovered = location[0]['latest']['recovered']
  12. print(covid19.getLatest())
  13. ##################################################################
  14.  
  15.  
  16.  
  17. root = Tk()
  18. root.title("CoronaVirusChecker")
  19.  
  20.  
  21.  
  22. f = tk.Frame(root,width=800,height=600)
  23. f.grid(row=0,column=0,sticky="NW")
  24. f.grid_propagate(0)
  25. f.update()
  26.  
  27. C = tk.Canvas(root, bg="blue", height=250, width=300)
  28.  
  29. background_label = tk.Label(root,)
  30. background_label.place(x=0, y=0, relwidth=1, relheight=1)
  31.  
  32. w = tk.Label(root,text="Aktualne dane Covid-19 w Polsce:")
  33. w.place(x=400, y=200, anchor="center")
  34. w.config(font=("Courier", 30))
  35.  
  36.  
  37. l = tk.Label(root,text="Przypadki: "+str(confirmed)+"\n"+" Śmierci:"+str(deaths)+"\n"+" Wyleczeni: "+str(recovered))
  38. l.place(x=400, y=300, anchor="center")
  39. l.config(font=("Courier", 30))
  40.  
  41.  
  42.  
  43. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement