First Rendition of Problem Generator
This commit is contained in:
29
main.py
Normal file
29
main.py
Normal 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()
|
||||
Reference in New Issue
Block a user