TO-Do list with PyScript 📝
You can use ENTER ↩
to insert a TO-Do Task.
Enter Work Name, Work Details
to insert a TO-Do Task.
def on_keypress(e):
if(e.code == "Enter"):
add_contact()
def on_click(evt):
add_contact()
from datetime import datetime as dt
def extract(new_entry):
return [x.strip() for x in new_entry.split(',')]
def add_contact():
name, work = extract(new_entry.value)
guest = {"name": name, "work": work, "deleted": False, "created_at": dt.now()}
todoBook.add(guest)
new_entry.clear()