-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKanya_api.py
More file actions
49 lines (21 loc) · 854 Bytes
/
Copy pathKanya_api.py
File metadata and controls
49 lines (21 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from tkinter import *
import requests
def press():
data=requests.get(url="https://api.kanye.rest/")
data.raise_for_status()
data_response=data.json()
data_response_quote=data_response["quote"]
canvas.itemconfig(kanya_txt,text=data_response_quote)
windows=Tk()
windows.minsize(width=350,height=600)
windows.title("Kanya Scroll")
canvas=Canvas(width=300,height=440)
background_img=PhotoImage(file="background.png")
canvas.create_image(150,220,image=background_img)
kanya_txt=canvas.create_text(150,250,text="Kanya Quote show here.",width=200,fill="white",font=("cursive",30,"bold"))
canvas.pack()
#button img
kanya_img=PhotoImage(file="kanye.png")
kanye_button=Button(image=kanya_img,highlightthickness=0,command=press)
kanye_button.pack()
windows.mainloop()