How to build your own Wolfram Alpha — Math Equation Visualization with Tkinter and wolframalpha API
Hello Everyone! My name is Andrew Fung, in this video, I will be showing you how to create your own Math Equation Visualiser using python’s Tkinter Library and Wolfram Alpha API.
#wolframalpha #tkinter #datavisualization #python #replit
Installation and Setup!
Replit: https://replit.com/
Wolfram Alpha: https://www.wolframalpha.com
Wolfram Alpha API: https://products.wolframalpha.com/api/
Documentation: https://products.wolframalpha.com/simple-api/documentation/
Tkinter documentation: https://docs.python.org/3/library/tkinter.html
Source code for this project:
https://github.com/Andrew-FungKinHo/YouTube/blob/main/wolframAlpha.py
Check out my Github!
https://github.com/Andrew-FungKinHo
How I make my YouTube videos:
⌨️ Keyboard - Nuphy Air75 Mechanical Keyboard - https://amzn.to/3Xu4PD3
🎙 Microphone - MAONO A04 Professional Podcaster USB Microphone - https://amzn.to/3k8ocD5
🖱 Mouse - Microsoft Bluetooth Ergonomic Mouse - https://amzn.to/3CHhdHJ
🔌 Accessories - Laptop Docking Station for MacBook Pro - https://amzn.to/3CHi5Mv
Timestamps
0:00 | Intro
1:56 | Data Fetching from API
9:10 | User Interface with Tkinter
22:28 | Project improvement
24:02 | Out tro
Full code:
———————————————————————————————
import wolframalpha
import base64
import tkinter as tk
from urllib.request import urlopen
API_KEY = ‘INSERT YOUR API KEY HERE’
client = wolframalpha.Client(API_KEY)
def math():
equation = entry1.get()
res = client.query(equation.strip(),params=(("format", "image,plaintext"),))
data = {}
for p in res.pods:
for s in p.subpods:
if s.img.alt.lower() == "root plot":
data['rootPlot'] = s.img.src
elif s.img.alt.lower() == "number line":
data['numberLine'] = s.img.src
data['results'] = [i.texts for i in list(res.results)][0]
image1_url = data['rootPlot']
image2_url = data['numberLine']
image1_byt = urlopen(image1_url).read()
image1_b64 = base64.encodebytes(image1_byt)
photo1 = tk.PhotoImage(data=image1_b64)
image2_byt = urlopen(image2_url).read()
image2_b64 = base64.encodebytes(image2_byt)
photo2 = tk.PhotoImage(data=image2_b64)
canvas.photo1 = photo1
canvas.photo2 = photo2
canvas.create_image(10,30, image=canvas.photo1, anchor='nw')
canvas.create_text(175,40, fill='darkblue',font='Arial 10',text='Root Plot')
canvas.create_image(10,240, image=canvas.photo2, anchor='nw')
canvas.create_text(175,230, fill='darkblue',font='Arial 10',text='Number Line')
canvas.create_text(175,320,fill='darkblue',font='Arial 15',text=data['results'])
root = tk.Tk()
root.title("Math Visualization")
w = 500
h = 500
x = 50
y = 100
root.geometry("%dx%d+%d+%d" % (w,h,x,y))
canvas = tk.Canvas(bg='white')
canvas.config(height=350)
canvas.pack()
# entry
entry1 = tk.Entry(root)
canvas.create_window(150,15,window=entry1)
# submit button
submit = tk.Button(text="Solve",command=math,height=1, width=3)
canvas.create_window(280,15,window=submit)
root.mainloop()
———————————————————————————————
Feel free to drop a like and comment if you enjoy and video and let me know if you want me to do other types of programming videos ;) !!!
Видео How to build your own Wolfram Alpha — Math Equation Visualization with Tkinter and wolframalpha API канала Andrew Fung
#wolframalpha #tkinter #datavisualization #python #replit
Installation and Setup!
Replit: https://replit.com/
Wolfram Alpha: https://www.wolframalpha.com
Wolfram Alpha API: https://products.wolframalpha.com/api/
Documentation: https://products.wolframalpha.com/simple-api/documentation/
Tkinter documentation: https://docs.python.org/3/library/tkinter.html
Source code for this project:
https://github.com/Andrew-FungKinHo/YouTube/blob/main/wolframAlpha.py
Check out my Github!
https://github.com/Andrew-FungKinHo
How I make my YouTube videos:
⌨️ Keyboard - Nuphy Air75 Mechanical Keyboard - https://amzn.to/3Xu4PD3
🎙 Microphone - MAONO A04 Professional Podcaster USB Microphone - https://amzn.to/3k8ocD5
🖱 Mouse - Microsoft Bluetooth Ergonomic Mouse - https://amzn.to/3CHhdHJ
🔌 Accessories - Laptop Docking Station for MacBook Pro - https://amzn.to/3CHi5Mv
Timestamps
0:00 | Intro
1:56 | Data Fetching from API
9:10 | User Interface with Tkinter
22:28 | Project improvement
24:02 | Out tro
Full code:
———————————————————————————————
import wolframalpha
import base64
import tkinter as tk
from urllib.request import urlopen
API_KEY = ‘INSERT YOUR API KEY HERE’
client = wolframalpha.Client(API_KEY)
def math():
equation = entry1.get()
res = client.query(equation.strip(),params=(("format", "image,plaintext"),))
data = {}
for p in res.pods:
for s in p.subpods:
if s.img.alt.lower() == "root plot":
data['rootPlot'] = s.img.src
elif s.img.alt.lower() == "number line":
data['numberLine'] = s.img.src
data['results'] = [i.texts for i in list(res.results)][0]
image1_url = data['rootPlot']
image2_url = data['numberLine']
image1_byt = urlopen(image1_url).read()
image1_b64 = base64.encodebytes(image1_byt)
photo1 = tk.PhotoImage(data=image1_b64)
image2_byt = urlopen(image2_url).read()
image2_b64 = base64.encodebytes(image2_byt)
photo2 = tk.PhotoImage(data=image2_b64)
canvas.photo1 = photo1
canvas.photo2 = photo2
canvas.create_image(10,30, image=canvas.photo1, anchor='nw')
canvas.create_text(175,40, fill='darkblue',font='Arial 10',text='Root Plot')
canvas.create_image(10,240, image=canvas.photo2, anchor='nw')
canvas.create_text(175,230, fill='darkblue',font='Arial 10',text='Number Line')
canvas.create_text(175,320,fill='darkblue',font='Arial 15',text=data['results'])
root = tk.Tk()
root.title("Math Visualization")
w = 500
h = 500
x = 50
y = 100
root.geometry("%dx%d+%d+%d" % (w,h,x,y))
canvas = tk.Canvas(bg='white')
canvas.config(height=350)
canvas.pack()
# entry
entry1 = tk.Entry(root)
canvas.create_window(150,15,window=entry1)
# submit button
submit = tk.Button(text="Solve",command=math,height=1, width=3)
canvas.create_window(280,15,window=submit)
root.mainloop()
———————————————————————————————
Feel free to drop a like and comment if you enjoy and video and let me know if you want me to do other types of programming videos ;) !!!
Видео How to build your own Wolfram Alpha — Math Equation Visualization with Tkinter and wolframalpha API канала Andrew Fung
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Trial and Error (Ep.2): Python Import Error from Saving Filename same as Python Module Name #Shorts](https://i.ytimg.com/vi/tE28XAz4pP0/default.jpg)
![Smart Fan Presentation](https://i.ytimg.com/vi/Tg3nHFNGaO8/default.jpg)
![Wine Quality Prediction with Machine Learning (part 1) — Data preprocessing and Feature Correlation](https://i.ytimg.com/vi/vXL2eDnih0I/default.jpg)
![Set webhook and message handlers — Creating a CRM distribution Telegram bot with Notion API (EP.2)](https://i.ytimg.com/vi/HsugJwBuH-Q/default.jpg)
![Scripting Audio Conversations (part 2) - User Files Upload with Google SpeechToText and Python Dash](https://i.ytimg.com/vi/mOMZmY3VgHA/default.jpg)
![SONAS - Speech to Text App for the Hearing Impaired](https://i.ytimg.com/vi/qhEXHAxdqno/default.jpg)
![How to build an Interactive Ad-scraping Keyword Analysis Web App with Streamlit Python & ScraperAPI](https://i.ytimg.com/vi/yb1OF33pNTQ/default.jpg)
![How to Schedule CronJobs to Send Email Notifications — Python Task Automation with CronJobs (part 2)](https://i.ytimg.com/vi/vscDphDAcQM/default.jpg)
![Wine Quality Prediction with Machine Learning (part 2) — Train Test Split & Linear Regression Plots](https://i.ytimg.com/vi/xZpTxIWfDv4/default.jpg)
![Finding the correlation coefficients between two variables --- Data Analysis with Python and Pandas](https://i.ytimg.com/vi/VB9tFoX4icw/default.jpg)
![How to plot moving race bars animation — Data Visualisation with Python and Pandas](https://i.ytimg.com/vi/ZkgoJk6-3o4/default.jpg)
![Finding the Most Profitable Keywords by Plotting Competitor Analysis Graphs — with Python Streamlit](https://i.ytimg.com/vi/3YVUe6uGieI/default.jpg)
![Build and deploy a simple bot — Creating a CRM distribution Telegram bot with Notion API (EP.1)](https://i.ytimg.com/vi/sfCkKnBhULs/default.jpg)
![Create a Simple Programming Joke Generator that look like a Tweet -with HTML, CSS and Javascript](https://i.ytimg.com/vi/RpFI0kSwlYI/default.jpg)
![First steps to approach a dataset — Introduction to Data analysis with Pandas and Python](https://i.ytimg.com/vi/uZVK-WtimTk/default.jpg)
![User authentication and customized messages — Creating a CRM Telegram bot with Notion API (EP.3)](https://i.ytimg.com/vi/un30EJ9NVsA/default.jpg)
![Sending documents and updating customer status — Creating a CRM Telegram bot with Notion API (EP.4)](https://i.ytimg.com/vi/xuxtnFG9CxQ/default.jpg)
![How to Automate Web Scraping Task with BeautifulSoup — Python Task Automation with CronJobs (part 1)](https://i.ytimg.com/vi/Z4OBn83Rmj8/default.jpg)
![Targeted Keyword and Competitor Analysis with Google Ads — Python Web Scraping Task Automation](https://i.ytimg.com/vi/DXju-2RF4jw/default.jpg)
![Animating HTML Ranking Table with Javascript & JQuery — Realtime Crypto Prices Changes Leaderboard](https://i.ytimg.com/vi/bppuXpcJUvk/default.jpg)