0

How do I play a GIF file in Python? I'm making a button that gives you a Kanye West quote. And I want it to display this gif:

gif1

below the quote. This is my code:

import requests
import tkinter as tk
import PySimpleGUI as sg
from tkinter.ttk import *
import tkinter.messagebox as tkmb
from tkinter import *

URL = "https://api.kanye.rest/"

r = requests.get(url=URL)

data = r.json()

Kanye_brain = data["quote"]

print(r)
print(Kanye_brain)

def write_slogan():
    # spørsmåls vindu
    top_win = tk.Toplevel(master)
    top_win.title('Kanye Brain Booster')
    info_message = Kanye_brain
    top_win.minsize(300, 15)
    # kanye tweet
    tk.Label(top_win,  text=info_message).grid(row=0, column=0)

master = tk.Tk()
master.title('Kanye Brain Booster')
master.minsize(300, 15)

btn = tk.Button(master, text='Trenger du høyere IQ?', command=write_slogan,)
btn.grid(row=3, column=1, sticky=tk.W, pady=4)

master.mainloop()

Can somebody help?

John Wess
  • 1
  • 5

0 Answers0