top of page

Getting quotes and displaying them

  • Writer: 라임 샹큼
    라임 샹큼
  • Apr 3
  • 1 min read

from tkinter import *

import requests




def get_quote():

    quote_url = requests.get(url='https://api.kanye.rest')

    quote_json = quote_url.json()

    actual_quote = quote_json['quote']

    canvas.itemconfig(quote_text, text = actual_quote)


window = Tk()

window.title("Kanye Says...")

window.config(padx=50, pady=50)


canvas = Canvas(width=300, height=414)

background_img = PhotoImage(file="background.png")

canvas.create_image(150, 207, image=background_img)

quote_text = canvas.create_text(150, 207, text="Kanye Quote Goes HERE", width=250, font=("Arial", 30, "bold"), fill="white")

canvas.grid(row=0, column=0)


kanye_img = PhotoImage(file="kanye.png")

kanye_button = Button(image=kanye_img, highlightthickness=0, command=get_quote)

kanye_button.grid(row=1, column=0)




window.mainloop()

 
 
 

Recent Posts

See All
Stock market price alerter

Lately I’ve been getting API data from existing data and using it to get actual live data. This is done by importing requests.  This was...

 
 
 
Making a better quiz ui

I reencountered classes again. I remember I had a a hard time learning how classes were different from simply defining functions. It was...

 
 
 
Password Manager

import tkinter from tkinter import messagebox from tkinter import PhotoImage import random # ---------------------------- PASSWORD...

 
 
 

1 Comment


COP
COP
May 10

Calculate Your Age Instantly with Our Smart Age Calculator! 🧮

Ever wondered exactly how old you are — not just in years, but in months, days, hours, or even seconds? Our Age Calculator is the easiest and most accurate way to find out!

Whether you're planning a birthday party, tracking milestones, or just having fun with friends, our tool delivers precise results in real time. It's more than just a number — it's your life's timeline!

🔍 Why Use Our Online Age Calculator?

Instant & Accurate: Just input your date of birth, and get a detailed breakdown of your age in years, months, days, hours, minutes, and seconds — updated live.✅ No Hassle, No Sign-Up: Use it right away without creating…

Like

© 2024 by GifTED. Powered and secured by Wix

bottom of page