First Rendition of Problem Generator

This commit is contained in:
2026-04-26 16:21:29 -04:00
parent 6983688180
commit d90784ae0d
4 changed files with 273 additions and 0 deletions

29
main.py Normal file
View File

@@ -0,0 +1,29 @@
#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()