[[fetch]]
files = ['main.py']
from pyscript import when, display, document
from main import converter
@when("click", "#clear_btn")
def clear_all(event):
document.getElementById("degree").value = ""
document.getElementById("result").innerHTML = ""
@when("click", "#convert_btn")
def click_handler(event):
degree = document.getElementById("degree").value
try:
result = converter(degree)
document.getElementById("result").innerHTML = f"{result}"
except Exception as e:
document.getElementById("result").innerHTML = f"Error: {e}"