How To Create A GUI Program In Python Using Tkinter (EASY) 💻 | Fun Fact Generator

Published: 12 September 2020
on channel: Coding Is Fun
3,927
70

👉 Explore All My Excel Solutions: https://pythonandvba.com/solutions

𝗗𝗘𝗦𝗖𝗥𝗜𝗣𝗧𝗜𝗢𝗡
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
In this tutorial, I will show you, how you can build you own Fun Fact Generator GUI in Python by using the library Tkinter & a free API.

👉 You can download the code for free here:
https://drive.google.com/uc?export=do...

🚩 HERE IS THE CODE:
import json
import requests
from tkinter import *

window = Tk()
window.title("Fun Fact Generator")
window.geometry('800x80')

def get_fun_fact():
url ="https://uselessfacts.jsph.pl/random.j..."
response = requests.request("GET", url)
data = json.loads(response.text)
useless_fact = data['text']
lbl.configure(text=useless_fact)

btn = Button(window,text='Click Me', command=get_fun_fact)
btn.pack()

lbl = Label(window, text='Click the button to get a random fact')
lbl.pack()

window.mainloop()

𝗧𝗢𝗢𝗟𝗦 𝗔𝗡𝗗 𝗥𝗘𝗦𝗢𝗨𝗥𝗖𝗘𝗦
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
🆓【𝗙𝗥𝗘𝗘】Excel Add-in (𝗠𝘆𝗧𝗼𝗼𝗹𝗕𝗲𝗹𝘁): https://pythonandvba.com/mytoolbelt
📊 Dashboard Excel Add-In (𝗚𝗿𝗮𝗳𝗹𝘆): https://pythonandvba.com/grafly
🎨 Cartoon Charts Excel Add-In (𝗖𝘂𝘁𝗲𝗣𝗹𝗼𝘁𝘀): https://pythonandvba.com/cuteplots
🤪 Fun Emoji Excel Add-In (𝗘𝗺𝗼𝗷𝗶𝗳𝘆): https://pythonandvba.com/emojify
📑 Excel Templates: https://pythonandvba.com/go/excel-tem...
🎓 My Courses: https://pythonandvba.com/go/courses
📚 Books, Tools, and More: https://pythonandvba.com/resources

𝗖𝗢𝗡𝗡𝗘𝗖𝗧 𝗪𝗜𝗧𝗛 𝗠𝗘
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
🔗 LinkedIn:   / sven-bosau  
📸 Instagram:   / codingisfun_official  
💻 GitHub: https://github.com/Sven-Bo
💬 Discord: https://pythonandvba.com/discord
📬 Contact: https://pythonandvba.com/contact

☕ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲?
If you want to support this channel, you can buy me a coffee here: https://pythonandvba.com/coffee-donation


On this page of the site you can watch the video online How To Create A GUI Program In Python Using Tkinter (EASY) 💻 | Fun Fact Generator with a duration of hours minute second in good quality, which was uploaded by the user Coding Is Fun 12 September 2020, share the link with friends and acquaintances, this video has already been watched 3,927 times on youtube and it was liked by 70 viewers. Enjoy your viewing!