Files
Youtube_Math/main.py

29 lines
703 B
Python

#All Rights Reserved John Salguero
#Starts the backend to my Youtube stream
import requests
from problem_generator import generate_problem
# url used to solve the math problems
url = "https://api.mathhook.com/solve"
#define the entry point to the programs
def main():
problem = generate_problem()
mathhook_payload = {
"action": "solve",
"expression": problem["problem"],
"steps": True
}
response = requests.post(url, json=mathhook_payload)
print("Generated Problem:")
print(problem)
print("Solve:")
print(response.status_code)
print(response.text)
#Starts the program
if __name__ == "__main__":
main()